aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerge E. Hallyn <serue@us.ibm.com>2009-03-25 12:39:54 -0500
committerWilly Tarreau <w@1wt.eu>2009-04-13 11:19:02 +0200
commit1c06d5237647db43cb2043a19cb393f4ed4d942f (patch)
tree8582922f0f3150686637c9370d7758a4b31e730f
parent64c39dcf96b3e1ae95593f301dae4aa9f1cbdd65 (diff)
downloadlinux-2.4-1c06d5237647db43cb2043a19cb393f4ed4d942f.tar.gz
CAP_FS_MASK: add CAP_LINUX_IMMUTABLE and CAP_MKNOD
When POSIX capabilities were introduced during the 2.1 Linux cycle, the fs mask, which represents the capabilities which having fsuid==0 is supposed to grant, did not include CAP_MKNOD and CAP_LINUX_IMMUTABLE. However, before capabilities the privilege to call these did in fact depend upon fsuid==0. This patch introduces those capabilities into the fsmask, restoring the old behavior. See the thread starting at http://lkml.org/lkml/2009/3/11/157 for reference. Reported-by: Igor Zhbanov <izh1979@gmail.com> Signed-off-by: Serge E. Hallyn <serue@us.ibm.com> Cc: stable@kernel.org Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--include/linux/capability.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/capability.h b/include/linux/capability.h
index 73e97280301544..eb2470744cfea9 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -99,10 +99,6 @@ typedef __u32 kernel_cap_t;
#define CAP_FSETID 4
-/* Used to decide between falling back on the old suser() or fsuser(). */
-
-#define CAP_FS_MASK 0x1f
-
/* Overrides the restriction that the real or effective user ID of a
process sending a signal must match the real or effective user ID
of the process receiving the signal. */
@@ -301,6 +297,16 @@ extern kernel_cap_t cap_bset;
#endif
+/* Used to decide between falling back on the old suser() or fsuser(). */
+
+#define CAP_FS_MASK (CAP_TO_MASK(CAP_CHOWN) \
+ | CAP_TO_MASK(CAP_DAC_OVERRIDE) \
+ | CAP_TO_MASK(CAP_DAC_READ_SEARCH) \
+ | CAP_TO_MASK(CAP_FOWNER) \
+ | CAP_TO_MASK(CAP_FSETID) \
+ | CAP_TO_MASK(CAP_LINUX_IMMUTABLE) \
+ | CAP_TO_MASK(CAP_MKNOD))
+
#define CAP_EMPTY_SET to_cap_t(0)
#define CAP_FULL_SET to_cap_t(~0)
#define CAP_INIT_EFF_SET to_cap_t(~0 & ~CAP_TO_MASK(CAP_SETPCAP))