diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/dummy.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/security/dummy.c b/security/dummy.c index f50c6c3c32c9..b8916883b77f 100644 --- a/security/dummy.c +++ b/security/dummy.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/hugetlb.h> | 27 | #include <linux/hugetlb.h> |
28 | #include <linux/ptrace.h> | 28 | #include <linux/ptrace.h> |
29 | #include <linux/file.h> | 29 | #include <linux/file.h> |
30 | #include <linux/prctl.h> | ||
31 | #include <linux/securebits.h> | ||
30 | 32 | ||
31 | static int dummy_ptrace (struct task_struct *parent, struct task_struct *child) | 33 | static int dummy_ptrace (struct task_struct *parent, struct task_struct *child) |
32 | { | 34 | { |
@@ -607,7 +609,27 @@ static int dummy_task_kill (struct task_struct *p, struct siginfo *info, | |||
607 | static int dummy_task_prctl (int option, unsigned long arg2, unsigned long arg3, | 609 | static int dummy_task_prctl (int option, unsigned long arg2, unsigned long arg3, |
608 | unsigned long arg4, unsigned long arg5, long *rc_p) | 610 | unsigned long arg4, unsigned long arg5, long *rc_p) |
609 | { | 611 | { |
610 | return 0; | 612 | switch (option) { |
613 | case PR_CAPBSET_READ: | ||
614 | *rc_p = (cap_valid(arg2) ? 1 : -EINVAL); | ||
615 | break; | ||
616 | case PR_GET_KEEPCAPS: | ||
617 | *rc_p = issecure(SECURE_KEEP_CAPS); | ||
618 | break; | ||
619 | case PR_SET_KEEPCAPS: | ||
620 | if (arg2 > 1) | ||
621 | *rc_p = -EINVAL; | ||
622 | else if (arg2) | ||
623 | current->securebits |= issecure_mask(SECURE_KEEP_CAPS); | ||
624 | else | ||
625 | current->securebits &= | ||
626 | ~issecure_mask(SECURE_KEEP_CAPS); | ||
627 | break; | ||
628 | default: | ||
629 | return 0; | ||
630 | } | ||
631 | |||
632 | return 1; | ||
611 | } | 633 | } |
612 | 634 | ||
613 | static void dummy_task_reparent_to_init (struct task_struct *p) | 635 | static void dummy_task_reparent_to_init (struct task_struct *p) |