• Stephen Hemminger's avatar
    sysctl: allow override of /proc/sys/net with CAP_NET_ADMIN · 4ecb9009
    Stephen Hemminger authored
    Extend the permission check for networking sysctl's to allow modification
    when current process has CAP_NET_ADMIN capability and is not root.  This
    version uses the until now unused permissions hook to override the mode
    value for /proc/sys/net if accessed by a user with capabilities.
    
    Found while working with Quagga.  It is impossible to turn forwarding
    on/off through the command interface because Quagga uses secure coding
    practice of dropping privledges during initialization and only raising via
    capabilities when necessary.  Since the dameon has reset real/effective
    uid after initialization, all attempts to access /proc/sys/net variables
    will fail.
    Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
    Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Chris Wright <chrisw@sous-sol.org>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Andrew Morgan <morgan@kernel.org>
    Cc: Pavel Emelyanov <xemul@openvz.org>
    Cc: "David S. Miller" <davem@davemloft.net>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    4ecb9009
sysctl_net.c 3.03 KB