diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-13 13:32:07 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-13 13:32:07 -0700 |
commit | 3423166fdbc2444bf3a4a27af1d7508364a17be7 (patch) | |
tree | 0a42bd5fbe6bcca79802bf1ec5af6acf12aadd82 /kernel/sys.c | |
parent | e9b57cca3dbdc7a0b90514af8bf613baf97105a5 (diff) | |
parent | 7d93101fc71ec47c7cc66ac99f76ef795c5207aa (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 40701538fbd1..e7006eb6c1e4 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -444,6 +444,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd, magic2 != LINUX_REBOOT_MAGIC2C)) return -EINVAL; + /* + * If pid namespaces are enabled and the current task is in a child + * pid_namespace, the command is handled by reboot_pid_ns() which will + * call do_exit(). + */ + ret = reboot_pid_ns(task_active_pid_ns(current), cmd); + if (ret) + return ret; + /* Instead of trying to make the power_off code look like * halt when pm_power_off is not set do it the easy way. */ @@ -1706,7 +1715,7 @@ static int prctl_set_mm(int opt, unsigned long addr, if (arg4 | arg5) return -EINVAL; - if (!capable(CAP_SYS_ADMIN)) + if (!capable(CAP_SYS_RESOURCE)) return -EPERM; if (addr >= TASK_SIZE) @@ -1962,6 +1971,14 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, case PR_SET_MM: error = prctl_set_mm(arg2, arg3, arg4, arg5); break; + case PR_SET_CHILD_SUBREAPER: + me->signal->is_child_subreaper = !!arg2; + error = 0; + break; + case PR_GET_CHILD_SUBREAPER: + error = put_user(me->signal->is_child_subreaper, + (int __user *) arg2); + break; default: error = -EINVAL; break; |