diff options
Diffstat (limited to 'security/commoncap.c')
-rw-r--r-- | security/commoncap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/security/commoncap.c b/security/commoncap.c index d45393380997..dc06c0086b55 100644 --- a/security/commoncap.c +++ b/security/commoncap.c | |||
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(cap_netlink_recv); | |||
49 | * returns 0 when a task has a capability, but the kernel's capable() | 49 | * returns 0 when a task has a capability, but the kernel's capable() |
50 | * returns 1 for this case. | 50 | * returns 1 for this case. |
51 | */ | 51 | */ |
52 | int cap_capable (struct task_struct *tsk, int cap) | 52 | int cap_capable(struct task_struct *tsk, int cap, int audit) |
53 | { | 53 | { |
54 | /* Derived from include/linux/sched.h:capable. */ | 54 | /* Derived from include/linux/sched.h:capable. */ |
55 | if (cap_raised(tsk->cap_effective, cap)) | 55 | if (cap_raised(tsk->cap_effective, cap)) |
@@ -112,7 +112,7 @@ static inline int cap_inh_is_capped(void) | |||
112 | * to the old permitted set. That is, if the current task | 112 | * to the old permitted set. That is, if the current task |
113 | * does *not* possess the CAP_SETPCAP capability. | 113 | * does *not* possess the CAP_SETPCAP capability. |
114 | */ | 114 | */ |
115 | return (cap_capable(current, CAP_SETPCAP) != 0); | 115 | return (cap_capable(current, CAP_SETPCAP, SECURITY_CAP_AUDIT) != 0); |
116 | } | 116 | } |
117 | 117 | ||
118 | static inline int cap_limit_ptraced_target(void) { return 1; } | 118 | static inline int cap_limit_ptraced_target(void) { return 1; } |
@@ -677,7 +677,7 @@ int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | |||
677 | || ((current->securebits & SECURE_ALL_LOCKS | 677 | || ((current->securebits & SECURE_ALL_LOCKS |
678 | & ~arg2)) /*[2]*/ | 678 | & ~arg2)) /*[2]*/ |
679 | || (arg2 & ~(SECURE_ALL_LOCKS | SECURE_ALL_BITS)) /*[3]*/ | 679 | || (arg2 & ~(SECURE_ALL_LOCKS | SECURE_ALL_BITS)) /*[3]*/ |
680 | || (cap_capable(current, CAP_SETPCAP) != 0)) { /*[4]*/ | 680 | || (cap_capable(current, CAP_SETPCAP, SECURITY_CAP_AUDIT) != 0)) { /*[4]*/ |
681 | /* | 681 | /* |
682 | * [1] no changing of bits that are locked | 682 | * [1] no changing of bits that are locked |
683 | * [2] no unlocking of locks | 683 | * [2] no unlocking of locks |
@@ -742,7 +742,7 @@ int cap_vm_enough_memory(struct mm_struct *mm, long pages) | |||
742 | { | 742 | { |
743 | int cap_sys_admin = 0; | 743 | int cap_sys_admin = 0; |
744 | 744 | ||
745 | if (cap_capable(current, CAP_SYS_ADMIN) == 0) | 745 | if (cap_capable(current, CAP_SYS_ADMIN, SECURITY_CAP_NOAUDIT) == 0) |
746 | cap_sys_admin = 1; | 746 | cap_sys_admin = 1; |
747 | return __vm_enough_memory(mm, pages, cap_sys_admin); | 747 | return __vm_enough_memory(mm, pages, cap_sys_admin); |
748 | } | 748 | } |