Skip to content

Commit 277642d

Browse files
committed
modules: make sysfs attribute files readable by owner only
This code goes back to the historical bitkeeper tree commit 3f7b0672086 ("Module section offsets in /sys/module"), where Jonathan Corbet wanted to show people how to debug loadable modules. See https://lwn.net/Articles/88052/ from June 2004. To expose the required load address information, Jonathan added the sections subdirectory for every module in /sys/modules, and made them S_IRUGO - readable by everybody. It was a more innocent time, plus those S_IRxxx macro names are a lot more confusing than the octal numbers are, so maybe it wasn't even intentional. But here we are, thirteen years later, and I'll just change it to S_IRUSR instead. Let's see if anybody even notices. Cc: Jonathan Corbet <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9d56041 commit 277642d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ static void add_sect_attrs(struct module *mod, const struct load_info *info)
15161516
sattr->mattr.show = module_sect_show;
15171517
sattr->mattr.store = NULL;
15181518
sattr->mattr.attr.name = sattr->name;
1519-
sattr->mattr.attr.mode = S_IRUGO;
1519+
sattr->mattr.attr.mode = S_IRUSR;
15201520
*(gattr++) = &(sattr++)->mattr.attr;
15211521
}
15221522
*gattr = NULL;

0 commit comments

Comments
 (0)