• Linus Torvalds's avatar
    modules: make sysfs attribute files readable by owner only · 277642dc
    Linus Torvalds authored
    This code goes back to the historical bitkeeper tree commit 3f7b0672
    ("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 <corbet@lwn.net>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    277642dc
module.c 110 KB