diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-03-16 18:34:20 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-23 14:55:25 -0700 |
commit | f40df5f22298327926688dce132c64351a029d4b (patch) | |
tree | 1e8dc0effc1c87bc2026b663744b904fd1df4a63 | |
parent | 0b94331d39f94e826c18a82a26415b5816af6d8f (diff) |
nfsd: nfsd should drop CAP_MKNOD for non-root
commit 76a67ec6fb79ff3570dcb5342142c16098299911 upstream.
Since creating a device node is normally an operation requiring special
privilege, Igor Zhbanov points out that it is surprising (to say the
least) that a client can, for example, create a device node on a
filesystem exported with root_squash.
So, make sure CAP_MKNOD is among the capabilities dropped when an nfsd
thread handles a request from a non-root user.
Reported-by: Igor Zhbanov <izh1979@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | include/linux/capability.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h index 9d1fe30b6f6..28863f4cc3d 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h @@ -382,8 +382,10 @@ typedef struct kernel_cap_struct { # define CAP_FULL_SET ((kernel_cap_t){{ ~0, ~0 }}) # define CAP_INIT_EFF_SET ((kernel_cap_t){{ ~CAP_TO_MASK(CAP_SETPCAP), ~0 }}) # define CAP_FS_SET ((kernel_cap_t){{ CAP_FS_MASK_B0, CAP_FS_MASK_B1 } }) -# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0|CAP_TO_MASK(CAP_SYS_RESOURCE), \ - CAP_FS_MASK_B1 } }) +# define CAP_NFSD_SET ((kernel_cap_t){{ CAP_FS_MASK_B0 \ + | CAP_TO_MASK(CAP_SYS_RESOURCE) \ + | CAP_TO_MASK(CAP_MKNOD), \ + CAP_FS_MASK_B1 } }) #endif /* _KERNEL_CAPABILITY_U32S != 2 */ |