[PATCH 0/7] proc: block mounts below /proc/<pid>/net and on the links into /proc/self
Aleksa Sarai
cyphar at cyphar.com
Mon Oct 26 22:34:59 PDT 2026
On 2026-10-24, Christian Brauner <brauner at kernel.org> wrote:
> Nuke this crap.
>
> [1]: https://lore.kernel.org/r/20240806-work-procfs-v1-0-fb04e1d09f0c@kernel.org
>
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
> ---
> Christian Brauner (7):
> proc: don't let an entry below /proc/<pid>/net be a mountpoint
> proc: don't let /proc/self and /proc/thread-self be mountpoints
> proc: don't let /proc/mounts and /proc/net be mountpoints
> afs: create /proc/fs/afs with proc_self_symlink()
> nfs: create the /proc/fs/nfsfs links with proc_self_symlink()
> proc: explain which entries can't be mountpoints
> selftests/proc: test which entries can't be mountpoints
I love it, nuke it from orbit.
Reviewed-by: Aleksa Sarai <aleksa at amutable.com>
The proc_net_d_revalidate() thing is particularly wild, I'm surprised it
hadn't come up to us in bug reports in the past ~10 years. I guess
nobody cared enough to try to mask it?
And yeah, it's a shame we couldn't kill this entirely but I'm looking
forward to the patch you mentioned that restricts who and what can be
over-mounted.
> fs/afs/main.c | 2 +-
> fs/nfs/client.c | 4 +-
> fs/proc/generic.c | 31 ++++-
> fs/proc/internal.h | 18 ++-
> fs/proc/proc_net.c | 2 +-
> fs/proc/root.c | 2 +-
> fs/proc/self.c | 2 +
> fs/proc/thread_self.c | 2 +
> include/linux/proc_fs.h | 5 +
> tools/testing/selftests/proc/.gitignore | 1 +
> tools/testing/selftests/proc/Makefile | 1 +
> tools/testing/selftests/proc/proc-unmountable.c | 150 ++++++++++++++++++++++++
> 12 files changed, 208 insertions(+), 12 deletions(-)
> ---
> base-commit: 7be4bc52fd9e0e55dc9a2e0232b89427d2c4b614
> change-id: 20261024-work-procfs-fixes-8b21a6d17448
--
Aleksa Sarai
Founding Engineer at Amutable
https://www.cyphar.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 265 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20261027/91d3cbb0/attachment.sig>
More information about the linux-afs
mailing list