[RH7] pid: Use proper ns in proc_dointvec_pidmax()

Submitted by Kirill Tkhai on Oct. 20, 2020, 9:40 a.m.

Details

Message ID 160318682097.139042.11063082558017950235.stgit@localhost.localdomain
State New
Series "pid: Use proper ns in proc_dointvec_pidmax()"
Headers show

Commit Message

Kirill Tkhai Oct. 20, 2020, 9:40 a.m.
Use current task pid ns instead of pid ns for future children

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 0e3aa418a87f..34dcbc792482 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);
 }