aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/capability.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/capability.c b/kernel/capability.c
index 19f9eda89975..adb262f83de1 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -514,6 +514,11 @@ asmlinkage long sys_capset(cap_user_header_t header, const cap_user_data_t data)
514 */ 514 */
515int capable(int cap) 515int capable(int cap)
516{ 516{
517 if (unlikely(!cap_valid(cap))) {
518 printk(KERN_CRIT "capable() called with invalid cap=%u\n", cap);
519 BUG();
520 }
521
517 if (has_capability(current, cap)) { 522 if (has_capability(current, cap)) {
518 current->flags |= PF_SUPERPRIV; 523 current->flags |= PF_SUPERPRIV;
519 return 1; 524 return 1;