[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YULmjmBL9fIx6XwB@infradead.org>
Date: Thu, 16 Sep 2021 07:39:10 +0100
From: Christoph Hellwig <hch@...radead.org>
To: Vivek Goyal <vgoyal@...hat.com>
Cc: viro@...iv.linux.org.uk,
Linux fsdevel mailing list <linux-fsdevel@...r.kernel.org>,
linux kernel mailing list <linux-kernel@...r.kernel.org>,
Jan Kara <jack@...e.cz>, xu.xin16@....com.cn,
Christoph Hellwig <hch@...radead.org>, zhang.yunkai@....com.cn
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@....de>
Powered by blists - more mailing lists