• L
    some fixes for pid_ns-Make-pid_max-per-namespace · 713041d0
    luojiajun 提交于
    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: Nluojiajun <luojiajun3@huawei.com>
    Reviewed-by: NHou Tao <houtao1@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    713041d0
pid.c 12.0 KB