Re: [PATCH v3] kernfs: recheck of->released after acquiring the active reference

From: Christian Brauner

Date: Tue Dec 01 2026 - 08:21:03 EST


On Fri, 28 Aug 2026 04:03:48 +0000, Fan Wu wrote:
> kernfs_get_active_of(), added by commit 3c9ba2777d6c ("kernfs: Fix UAF
> in polling when open file is released"), tests @of->released before
> acquiring the active reference on @of->kn. A hide/drain/show cycle can
> run between the two steps: the drain path releases the open file, and
> the reactivation lets kernfs_get_active() succeed again, so a file
> operation can run on an already released open file. On the cgroup
> pressure files, the poll callback dereferences of->priv while forming
> &ctx->psi.trigger and can hit either stale, freed memory or NULL.
>
> [...]

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] kernfs: recheck of->released after acquiring the active reference
https://git.kernel.org/vfs/vfs/c/8996b7c8174a