diff options
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, | |||
444 | magic2 != LINUX_REBOOT_MAGIC2C)) | 444 | magic2 != LINUX_REBOOT_MAGIC2C)) |
445 | return -EINVAL; | 445 | return -EINVAL; |
446 | 446 | ||
447 | /* | ||
448 | * If pid namespaces are enabled and the current task is in a child | ||
449 | * pid_namespace, the command is handled by reboot_pid_ns() which will | ||
450 | * call do_exit(). | ||
451 | */ | ||
452 | ret = reboot_pid_ns(task_active_pid_ns(current), cmd); | ||
453 | if (ret) | ||
454 | return ret; | ||
455 | |||
447 | /* Instead of trying to make the power_off code look like | 456 | /* Instead of trying to make the power_off code look like |
448 | * halt when pm_power_off is not set do it the easy way. | 457 | * halt when pm_power_off is not set do it the easy way. |
449 | */ | 458 | */ |
@@ -1706,7 +1715,7 @@ static int prctl_set_mm(int opt, unsigned long addr, | |||
1706 | if (arg4 | arg5) | 1715 | if (arg4 | arg5) |
1707 | return -EINVAL; | 1716 | return -EINVAL; |
1708 | 1717 | ||
1709 | if (!capable(CAP_SYS_ADMIN)) | 1718 | if (!capable(CAP_SYS_RESOURCE)) |
1710 | return -EPERM; | 1719 | return -EPERM; |
1711 | 1720 | ||
1712 | if (addr >= TASK_SIZE) | 1721 | if (addr >= TASK_SIZE) |
@@ -1962,6 +1971,14 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3, | |||
1962 | case PR_SET_MM: | 1971 | case PR_SET_MM: |
1963 | error = prctl_set_mm(arg2, arg3, arg4, arg5); | 1972 | error = prctl_set_mm(arg2, arg3, arg4, arg5); |
1964 | break; | 1973 | break; |
1974 | case PR_SET_CHILD_SUBREAPER: | ||
1975 | me->signal->is_child_subreaper = !!arg2; | ||
1976 | error = 0; | ||
1977 | break; | ||
1978 | case PR_GET_CHILD_SUBREAPER: | ||
1979 | error = put_user(me->signal->is_child_subreaper, | ||
1980 | (int __user *) arg2); | ||
1981 | break; | ||
1965 | default: | 1982 | default: |
1966 | error = -EINVAL; | 1983 | error = -EINVAL; |
1967 | break; | 1984 | break; |