Re: [PATCH v2] exit: hold a reference to thread_pid across proc_flush_pid
From: Christian Brauner
Date: Fri Sep 04 2026 - 06:27:54 EST
On Mon, 31 Aug 2026 09:12:21 +0900, Daehyeon Ko wrote:
> Commit 0a36bad01731 ("release_task: kill the no longer needed
> get/put_pid(thread_pid)") removed the reference around proc_flush_pid().
> It assumed that free_pids(post.pids) at the end of release_task() would
> keep thread_pid alive until then.
>
> That assumption is wrong. __change_pid() only records a detached PID in
> post.pids when pid_has_task() is false for every PIDTYPE. If another task
> still uses the exiting task's PID as its process group or session ID,
> __unhash_process() removes the exiting task's PIDTYPE_PID link but leaves
> the PID out of post.pids. release_task() therefore holds no reference to
> it after dropping tasklist_lock.
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] exit: hold a reference to thread_pid across proc_flush_pid
https://git.kernel.org/vfs/vfs/c/cdd812d0683d