Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8d6637d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

Pull module updates from Rusty Russell:
 "This finally applies the stricter sysfs perms checking we pulled out
  before last merge window.  A few stragglers are fixed (thanks
  linux-next!)"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  arch/powerpc/platforms/powernv/opal-dump.c: fix world-writable sysfs files
  arch/powerpc/platforms/powernv/opal-elog.c: fix world-writable sysfs files
  drivers/video/fbdev/s3c2410fb.c: don't make debug world-writable.
  ARM: avoid ARM binutils leaking ELF local symbols
  scripts: modpost: Remove numeric suffix pattern matching
  scripts: modpost: fix compilation warning
  sysfs: disallow world-writable files.
  module: return bool from within_module*()
  module: add within_module() function
  modules: Fix build error in moduleloader.h
parents 801a71a8 76215b04
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -102,9 +102,9 @@ static ssize_t dump_ack_store(struct dump_obj *dump_obj,
 * due to the dynamic size of the dump
 * due to the dynamic size of the dump
 */
 */
static struct dump_attribute id_attribute =
static struct dump_attribute id_attribute =
	__ATTR(id, 0666, dump_id_show, NULL);
	__ATTR(id, S_IRUGO, dump_id_show, NULL);
static struct dump_attribute type_attribute =
static struct dump_attribute type_attribute =
	__ATTR(type, 0666, dump_type_show, NULL);
	__ATTR(type, S_IRUGO, dump_type_show, NULL);
static struct dump_attribute ack_attribute =
static struct dump_attribute ack_attribute =
	__ATTR(acknowledge, 0660, dump_ack_show, dump_ack_store);
	__ATTR(acknowledge, 0660, dump_ack_show, dump_ack_store);


+2 −2
Original line number Original line Diff line number Diff line
@@ -82,9 +82,9 @@ static ssize_t elog_ack_store(struct elog_obj *elog_obj,
}
}


static struct elog_attribute id_attribute =
static struct elog_attribute id_attribute =
	__ATTR(id, 0666, elog_id_show, NULL);
	__ATTR(id, S_IRUGO, elog_id_show, NULL);
static struct elog_attribute type_attribute =
static struct elog_attribute type_attribute =
	__ATTR(type, 0666, elog_type_show, NULL);
	__ATTR(type, S_IRUGO, elog_type_show, NULL);
static struct elog_attribute ack_attribute =
static struct elog_attribute ack_attribute =
	__ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);
	__ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);


+1 −1
Original line number Original line Diff line number Diff line
@@ -616,7 +616,7 @@ static int s3c2410fb_debug_store(struct device *dev,
	return len;
	return len;
}
}


static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store);
static DEVICE_ATTR(debug, 0664, s3c2410fb_debug_show, s3c2410fb_debug_store);


static struct fb_ops s3c2410fb_ops = {
static struct fb_ops s3c2410fb_ops = {
	.owner		= THIS_MODULE,
	.owner		= THIS_MODULE,
+2 −0
Original line number Original line Diff line number Diff line
@@ -845,5 +845,7 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
	 /* User perms >= group perms >= other perms */			\
	 /* User perms >= group perms >= other perms */			\
	 BUILD_BUG_ON_ZERO(((perms) >> 6) < (((perms) >> 3) & 7)) +	\
	 BUILD_BUG_ON_ZERO(((perms) >> 6) < (((perms) >> 3) & 7)) +	\
	 BUILD_BUG_ON_ZERO((((perms) >> 3) & 7) < ((perms) & 7)) +	\
	 BUILD_BUG_ON_ZERO((((perms) >> 3) & 7) < ((perms) & 7)) +	\
	 /* Other writable?  Generally considered a bad idea. */	\
	 BUILD_BUG_ON_ZERO((perms) & 2) +				\
	 (perms))
	 (perms))
#endif
#endif
+9 −2
Original line number Original line Diff line number Diff line
@@ -396,18 +396,25 @@ bool is_module_address(unsigned long addr);
bool is_module_percpu_address(unsigned long addr);
bool is_module_percpu_address(unsigned long addr);
bool is_module_text_address(unsigned long addr);
bool is_module_text_address(unsigned long addr);


static inline int within_module_core(unsigned long addr, const struct module *mod)
static inline bool within_module_core(unsigned long addr,
				      const struct module *mod)
{
{
	return (unsigned long)mod->module_core <= addr &&
	return (unsigned long)mod->module_core <= addr &&
	       addr < (unsigned long)mod->module_core + mod->core_size;
	       addr < (unsigned long)mod->module_core + mod->core_size;
}
}


static inline int within_module_init(unsigned long addr, const struct module *mod)
static inline bool within_module_init(unsigned long addr,
				      const struct module *mod)
{
{
	return (unsigned long)mod->module_init <= addr &&
	return (unsigned long)mod->module_init <= addr &&
	       addr < (unsigned long)mod->module_init + mod->init_size;
	       addr < (unsigned long)mod->module_init + mod->init_size;
}
}


static inline bool within_module(unsigned long addr, const struct module *mod)
{
	return within_module_init(addr, mod) || within_module_core(addr, mod);
}

/* Search for module by name: must hold module_mutex. */
/* Search for module by name: must hold module_mutex. */
struct module *find_module(const char *name);
struct module *find_module(const char *name);


Loading