mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
Merge patch series "Revert "pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers""
Commit 006568ab4c ("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().
* patches from https://patch.msgid.link/20251015123550.GA9447@redhat.com:
pid: introduce task_ppid_vnr() helper
Revert "pid: make __task_pid_nr_ns(ns => NULL) safe for zombie callers"
Link: https://patch.msgid.link/20251015123550.GA9447@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
commit
3673dd3c7d
3 changed files with 7 additions and 3 deletions
|
|
@ -446,7 +446,7 @@ static long pidfd_info(struct file *file, unsigned int cmd, unsigned long arg)
|
|||
* the fields are set correctly, or return ESRCH to avoid providing
|
||||
* incomplete information. */
|
||||
|
||||
kinfo.ppid = task_ppid_nr_ns(task, NULL);
|
||||
kinfo.ppid = task_ppid_vnr(task);
|
||||
kinfo.tgid = task_tgid_vnr(task);
|
||||
kinfo.pid = task_pid_vnr(task);
|
||||
kinfo.mask |= PIDFD_INFO_PID;
|
||||
|
|
|
|||
|
|
@ -310,6 +310,11 @@ static inline pid_t task_ppid_nr_ns(const struct task_struct *tsk, struct pid_na
|
|||
return pid;
|
||||
}
|
||||
|
||||
static inline pid_t task_ppid_vnr(const struct task_struct *tsk)
|
||||
{
|
||||
return task_ppid_nr_ns(tsk, NULL);
|
||||
}
|
||||
|
||||
static inline pid_t task_ppid_nr(const struct task_struct *tsk)
|
||||
{
|
||||
return task_ppid_nr_ns(tsk, &init_pid_ns);
|
||||
|
|
|
|||
|
|
@ -558,8 +558,7 @@ 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);
|
||||
nr = pid_nr_ns(rcu_dereference(*task_pid_ptr(task, type)), ns);
|
||||
rcu_read_unlock();
|
||||
|
||||
return nr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue