diff options
Diffstat (limited to 'security/dummy.c')
-rw-r--r-- | security/dummy.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/security/dummy.c b/security/dummy.c index 48d4b0a52737..649326bf64ea 100644 --- a/security/dummy.c +++ b/security/dummy.c | |||
@@ -36,14 +36,19 @@ static int dummy_ptrace (struct task_struct *parent, struct task_struct *child) | |||
36 | static int dummy_capget (struct task_struct *target, kernel_cap_t * effective, | 36 | static int dummy_capget (struct task_struct *target, kernel_cap_t * effective, |
37 | kernel_cap_t * inheritable, kernel_cap_t * permitted) | 37 | kernel_cap_t * inheritable, kernel_cap_t * permitted) |
38 | { | 38 | { |
39 | *effective = *inheritable = *permitted = 0; | ||
40 | if (target->euid == 0) { | 39 | if (target->euid == 0) { |
41 | *permitted |= (~0 & ~CAP_FS_MASK); | 40 | cap_set_full(*permitted); |
42 | *effective |= (~0 & ~CAP_TO_MASK(CAP_SETPCAP) & ~CAP_FS_MASK); | 41 | cap_set_init_eff(*effective); |
42 | } else { | ||
43 | cap_clear(*permitted); | ||
44 | cap_clear(*effective); | ||
43 | } | 45 | } |
44 | if (target->fsuid == 0) { | 46 | |
45 | *permitted |= CAP_FS_MASK; | 47 | cap_clear(*inheritable); |
46 | *effective |= CAP_FS_MASK; | 48 | |
49 | if (target->fsuid != 0) { | ||
50 | *permitted = cap_drop_fs_set(*permitted); | ||
51 | *effective = cap_drop_fs_set(*effective); | ||
47 | } | 52 | } |
48 | return 0; | 53 | return 0; |
49 | } | 54 | } |
@@ -402,7 +407,7 @@ static int dummy_inode_killpriv(struct dentry *dentry) | |||
402 | return 0; | 407 | return 0; |
403 | } | 408 | } |
404 | 409 | ||
405 | static int dummy_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | 410 | static int dummy_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc) |
406 | { | 411 | { |
407 | return -EOPNOTSUPP; | 412 | return -EOPNOTSUPP; |
408 | } | 413 | } |