diff options
| author | Paul Mackerras <paulus@samba.org> | 2008-06-16 00:53:25 -0400 |
|---|---|---|
| committer | Paul Mackerras <paulus@samba.org> | 2008-06-16 00:53:25 -0400 |
| commit | a9653cf540d407fb75deb3db65a1be6c81d53ee0 (patch) | |
| tree | 075fb79746f1d74443c9a9062e73c26a6266b05c /security/dummy.c | |
| parent | e80ac32767d0f781ac195c472d500a7451d3729a (diff) | |
| parent | 066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff) | |
Merge branch 'linux-2.6' into merge
Diffstat (limited to 'security/dummy.c')
| -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) |
