linux: implement PR_CHILD_SET_SUBREAPER

Reviewed by: imp, dchagin
Pull Request: https://github.com/freebsd/freebsd-src/pull/1260
This commit is contained in:
Son Phan Trung 2024-05-28 16:51:16 +07:00 committed by Warner Losh
parent bb421be6c1
commit 6d849754b9
2 changed files with 9 additions and 0 deletions

View file

@ -1819,6 +1819,14 @@ linux_prctl(struct thread *td, struct linux_prctl_args *args)
#endif
error = EINVAL;
break;
case LINUX_PR_SET_CHILD_SUBREAPER:
if (args->arg2 == 0){
return (kern_procctl(td, P_PID, 0, PROC_REAP_RELEASE,
NULL));
}
return (kern_procctl(td, P_PID, 0, PROC_REAP_ACQUIRE,
NULL));
case LINUX_PR_SET_NO_NEW_PRIVS:
arg = args->arg2 == 1 ?
PROC_NO_NEW_PRIVS_ENABLE : PROC_NO_NEW_PRIVS_DISABLE;

View file

@ -57,6 +57,7 @@
#define LINUX_PR_GET_SECCOMP 21
#define LINUX_PR_SET_SECCOMP 22
#define LINUX_PR_CAPBSET_READ 23
#define LINUX_PR_SET_CHILD_SUBREAPER 36
#define LINUX_PR_SET_NO_NEW_PRIVS 38
#define LINUX_PR_SET_PTRACER 1499557217