lkml.org 
[lkml]   [2021]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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>

\
 
 \ /
  Last update: 2021-09-16 08:40    [W:0.292 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site