Messages in this thread | | | Date | Thu, 16 Sep 2021 07:39:10 +0100 | From | Christoph Hellwig <> | Subject | Re: [PATCH] init/do_mounts.c: Harden split_fs_names() against buffer overflow |
| |
On Wed, Sep 15, 2021 at 11:22:04AM -0400, Vivek Goyal wrote: > Will be nice to pass size of input buffer to split_fs_names() and > put enough checks in place so such buffer overrun possibilities > do not occur.
Will be nice sounds weird.
> > Hence this patch adds "size" parameter to split_fs_names() and makes > sure we do not access memory beyond size. If input string "names" > is larger than passed in buffer, input string will be truncated to > fit in buffer.
There's really two aspects here: checking for a max size and explicitly passing one. I'm fine with passing the argument even if it always is PAGE_SIZE, but this should probably be documented a little better.
Otherwise looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
| |