Re: (subset) [PATCH 0/2] userns: clean up dead code on error paths
From: Christian Brauner
Date: Mon Aug 31 2026 - 06:26:19 EST
On Fri, 28 Aug 2026 17:16:57 +0800, Tao Cui wrote:
> From: Tao Cui <cuitao@xxxxxxxxxx>
>
> Two small cleanups on the create_user_ns() and map_write() error
> paths. Both remove code that provably cannot have an effect; no
> behavior change.
>
> user_namespace.c:164-167: the key_put() at fail_keyring has been
> dead since it was copy-pasted from free_user_ns() in 2016
> (dbec28460a89); persistent_keyring_register is only ever assigned
> lazily from key_get_persistent(), long after create_user_ns().
>
> [...]
Applied to the vfs-7.4.namespace branch of the vfs/vfs.git tree.
Patches in the vfs-7.4.namespace 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: master
[1/2] userns: remove dead key_put() on the create_user_ns() error path
https://git.kernel.org/vfs/vfs/c/fec2c3c0744b