[PATCH RESEND v2 47/51] proc: sysctl: look at the table under sysctl_lock when creating an inode
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 5 11:30:25 PST 2026
> proc_sys_make_inode() checks under sysctl_lock that @head isn't being
> unregistered, lets go of the lock, and then reads the mode of @table
> and calls ->set_ownership() with @head. That's fine as long as the
> caller holds @head in use, which keeps unregistering from getting past
> that check. The next patch has a caller that only pins the memory of
> @head. For that one the table, and whatever the owner of the header
> keeps behind it, is only there for as long as nobody unregisters the
> header, which happens under sysctl_lock. So read the mode and set the
> ownership before letting go of the lock. The ->set_ownership()
> callbacks only look up ids in a user namespace.
>
> No functional changes.
>
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org?part=47
More information about the kexec
mailing list