[PATCH RESEND v2 07/23] proc: let procfs own the seq_file of seq_file entries

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 5 11:35:27 PST 2026


> remove_proc_entry() waits until every call into the entry has returned.
> For a seq_file entry that's all of seq_read_iter(), including the copy
> to userspace. A page fault in that copy can be made to take as long as
> the reader wants, e.g. with userfaultfd or by punching holes into a
> memfd over and over. And callers of remove_proc_entry() like to hold
> locks while they wait. xt_hashlimit holds hashlimit_mutex, which all
> network namespaces share, and addrconf holds RTNL.
> 
> But the entry's code only runs between ->start() and ->stop() and the
> copies to userspace happen outside of that. So let procfs own the
> seq_file the way kernfs does. An entry declares its seq_operations, or
> just a show function, and the size of its private state in struct
> proc_ops. procfs then opens the seq_file with seq_operations it builds
> for the entry when it is registered: the entry's own ->next() and
> ->show() with a ->start() and ->stop() of procfs around them that pin
> [ ... ]
> 
> No users yet.
> 
> Suggested-by: Jann Horn <jannh at google.com>
> 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-core-v2-0-76ace653a773@kernel.org?part=7




More information about the kexec mailing list