Commit 713041d0 authored by luojiajun's avatar luojiajun Committed by Xie XiuQi
Browse files

some fixes for pid_ns-Make-pid_max-per-namespace



euler inclusion
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------

we find some bugs in pid_ns-Make-pid_max-per-namespace
1.In alloc pid, the current pid namespace's pid_max is used for
trying to allocate pids from the current pid namespace
to the parent pid namespaces until the root pid namespace
is reached. it's not correct. so using tmp->pid_max instead of
task_active_pid_ns(current)->pid_max.
2.In pid_ns_ctl_handler, init_pid_ns.pid_max is always used but
the value of ns_last_pid is already per-pid-namespace,
so extra2 field needs to be overridden by per-pid-namespace's
pid_max
3.In proc_dointvec_pidmax, We can use
task_active_pid_ns(current)->pid_max here. It's much shorter
and descriptive.
4.In __init pid_idr_init, kmemleak_not_leak is not be used,
it will cause memleak alarm but memory is actually not leak.

v1->v2:
fix some format problems
v2->v3:
use pid_ns instead of task_active_pid_ns(current)
in pid_ns_ctl_handler

Signed-off-by: default avatarluojiajun <luojiajun3@huawei.com>
Reviewed-by: default avatarHou Tao <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent b8bcbd99
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment