[RHEL7,COMMIT] pid: Use proper ns in proc_dointvec_pidmax()

Submitted by Vasily Averin on Nov. 10, 2020, 10:43 a.m.

Details

Message ID 202011101043.0AAAh2d1009987@vz7build.vvs.sw.ru
State New
Series "pid: Use proper ns in proc_dointvec_pidmax()"
Headers show

Commit Message

Vasily Averin Nov. 10, 2020, 10:43 a.m.
The commit is pushed to "branch-rh7-3.10.0-1160.2.2.vz7.170.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.2.2.el7
------>
commit 5d351a1f64cb1e192a94b51aff5d7efebe596487
Author: Kirill Tkhai <ktkhai@virtuozzo.com>
Date:   Tue Nov 10 13:43:02 2020 +0300

    pid: Use proper ns in proc_dointvec_pidmax()
    
    Use current task pid ns instead of pid ns for future children
    https://jira.sw.ru/browse/PSBM-121530
    Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 kernel/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index a958d57..6e2645d 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -339,7 +339,7 @@  static int proc_dointvec_pidmax(struct ctl_table *table, int write,
 	struct ctl_table tmp;
 
 	tmp = *table;
-	tmp.data = &current->nsproxy->pid_ns->pid_max;
+	tmp.data = &task_active_pid_ns(current)->pid_max;
 	return proc_dointvec_minmax(&tmp, write, buffer, lenp, ppos);
 }