diff options
Diffstat (limited to 'kernel/capability.c')
-rw-r--r-- | kernel/capability.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/capability.c b/kernel/capability.c index 14ea4210a530..283c529f8b1c 100644 --- a/kernel/capability.c +++ b/kernel/capability.c | |||
@@ -395,3 +395,15 @@ bool task_ns_capable(struct task_struct *t, int cap) | |||
395 | return ns_capable(task_cred_xxx(t, user)->user_ns, cap); | 395 | return ns_capable(task_cred_xxx(t, user)->user_ns, cap); |
396 | } | 396 | } |
397 | EXPORT_SYMBOL(task_ns_capable); | 397 | EXPORT_SYMBOL(task_ns_capable); |
398 | |||
399 | /** | ||
400 | * nsown_capable - Check superior capability to one's own user_ns | ||
401 | * @cap: The capability in question | ||
402 | * | ||
403 | * Return true if the current task has the given superior capability | ||
404 | * targeted at its own user namespace. | ||
405 | */ | ||
406 | bool nsown_capable(int cap) | ||
407 | { | ||
408 | return ns_capable(current_user_ns(), cap); | ||
409 | } | ||