diff options
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index d1fe71eb4546..4162d12390b6 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -1637,7 +1637,7 @@ asmlinkage long sys_umask(int mask) | |||
1637 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); | 1637 | mask = xchg(¤t->fs->umask, mask & S_IRWXUGO); |
1638 | return mask; | 1638 | return mask; |
1639 | } | 1639 | } |
1640 | 1640 | ||
1641 | asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | 1641 | asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, |
1642 | unsigned long arg4, unsigned long arg5) | 1642 | unsigned long arg4, unsigned long arg5) |
1643 | { | 1643 | { |
@@ -1742,6 +1742,17 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
1742 | error = prctl_set_seccomp(arg2); | 1742 | error = prctl_set_seccomp(arg2); |
1743 | break; | 1743 | break; |
1744 | 1744 | ||
1745 | case PR_CAPBSET_READ: | ||
1746 | if (!cap_valid(arg2)) | ||
1747 | return -EINVAL; | ||
1748 | return !!cap_raised(current->cap_bset, arg2); | ||
1749 | case PR_CAPBSET_DROP: | ||
1750 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
1751 | return cap_prctl_drop(arg2); | ||
1752 | #else | ||
1753 | return -EINVAL; | ||
1754 | #endif | ||
1755 | |||
1745 | default: | 1756 | default: |
1746 | error = -EINVAL; | 1757 | error = -EINVAL; |
1747 | break; | 1758 | break; |