mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
pidns: Capture the user namespace and filter ns_last_pid
- Capture the the user namespace that creates the pid namespace - Use that user namespace to test if it is ok to write to /proc/sys/kernel/ns_last_pid. Zhao Hongjiang <zhaohongjiang@huawei.com> noticed I was missing a put_user_ns in when destroying a pid_ns. I have foloded his patch into this one so that bisects will work properly. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
@@ -84,7 +84,7 @@ static struct nsproxy *create_new_namespaces(unsigned long flags,
|
||||
goto out_ipc;
|
||||
}
|
||||
|
||||
new_nsp->pid_ns = copy_pid_ns(flags, task_active_pid_ns(tsk));
|
||||
new_nsp->pid_ns = copy_pid_ns(flags, task_cred_xxx(tsk, user_ns), task_active_pid_ns(tsk));
|
||||
if (IS_ERR(new_nsp->pid_ns)) {
|
||||
err = PTR_ERR(new_nsp->pid_ns);
|
||||
goto out_pid;
|
||||
|
Reference in New Issue
Block a user