Re: [PATCH RESEND v2 00/30] proc: convert the fs, kernel and mm entries (Part 5/7)

From: Linus Torvalds

Date: Fri Nov 06 2026 - 15:10:45 EST


On Wed, 4 Nov 2026 at 15:35, Christian Brauner <brauner@xxxxxxxxxx> wrote:
>
> A git tree with all of the patches can be found at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=work.procfs.cleanup

Next comment: 3c7a6276d211 ("scsi: core: NUL-terminate what is
written to the host proc files") is nasty.

It does compares 'count' to PROC_BLOCK_SIZE, and then after that it
just allocates PAGE_SIZE and does

page[count] = '\0';

and it all *works*, but it depends on that PROC_BLOCK_SIZE being a
random value smaller than PAGE_SIZE:

#define PROC_BLOCK_SIZE (3*1024)

and yes, the minimum page size we support across architectures is 4k.

So this is a "it works, but it's still wrong" kind of thing. If making
changes in this area, please just fix these kinds of issues. Use the
*same* constant for size comparisons rather than two different ones.

Linus