aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 6a0cc71ee88d..f2a451366953 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1632,10 +1632,9 @@ asmlinkage long sys_umask(int mask)
1632asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3, 1632asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
1633 unsigned long arg4, unsigned long arg5) 1633 unsigned long arg4, unsigned long arg5)
1634{ 1634{
1635 long error; 1635 long uninitialized_var(error);
1636 1636
1637 error = security_task_prctl(option, arg2, arg3, arg4, arg5); 1637 if (security_task_prctl(option, arg2, arg3, arg4, arg5, &error))
1638 if (error)
1639 return error; 1638 return error;
1640 1639
1641 switch (option) { 1640 switch (option) {
@@ -1688,17 +1687,6 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
1688 error = -EINVAL; 1687 error = -EINVAL;
1689 break; 1688 break;
1690 1689
1691 case PR_GET_KEEPCAPS:
1692 if (current->keep_capabilities)
1693 error = 1;
1694 break;
1695 case PR_SET_KEEPCAPS:
1696 if (arg2 != 0 && arg2 != 1) {
1697 error = -EINVAL;
1698 break;
1699 }
1700 current->keep_capabilities = arg2;
1701 break;
1702 case PR_SET_NAME: { 1690 case PR_SET_NAME: {
1703 struct task_struct *me = current; 1691 struct task_struct *me = current;
1704 unsigned char ncomm[sizeof(me->comm)]; 1692 unsigned char ncomm[sizeof(me->comm)];
@@ -1732,17 +1720,6 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
1732 case PR_SET_SECCOMP: 1720 case PR_SET_SECCOMP:
1733 error = prctl_set_seccomp(arg2); 1721 error = prctl_set_seccomp(arg2);
1734 break; 1722 break;
1735
1736 case PR_CAPBSET_READ:
1737 if (!cap_valid(arg2))
1738 return -EINVAL;
1739 return !!cap_raised(current->cap_bset, arg2);
1740 case PR_CAPBSET_DROP:
1741#ifdef CONFIG_SECURITY_FILE_CAPABILITIES
1742 return cap_prctl_drop(arg2);
1743#else
1744 return -EINVAL;
1745#endif
1746 case PR_GET_TSC: 1723 case PR_GET_TSC:
1747 error = GET_TSC_CTL(arg2); 1724 error = GET_TSC_CTL(arg2);
1748 break; 1725 break;