Unverified Commit 1cf2e88e authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Christian Brauner
Browse files

Revert "pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers"



This reverts commit abdfd494.

The changelog in this commit explains why it is not easy to avoid ns == NULL
when the caller is exiting, but pid_vnr() is equally unsafe in this case.

However, commit 006568ab ("pid: Add a judgment for ns null in pid_nr_ns")
already added the ns != NULL check in pid_nr_ns(), so we can remove the same
check from __task_pid_nr_ns().

Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Link: https://patch.msgid.link/20251015123613.GA9456@redhat.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 87caaeef
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -558,7 +558,6 @@ pid_t __task_pid_nr_ns(struct task_struct *task, enum pid_type type,
	rcu_read_lock();
	if (!ns)
		ns = task_active_pid_ns(current);
	if (ns)
	nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
	rcu_read_unlock();