[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190719173811.GA4765@kroah.com>
Date: Fri, 19 Jul 2019 19:38:11 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Yin Fengwei <nh26223.lmm@...il.com>
Cc: dhowells@...hat.com, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com,
miklos@...redi.hu, viro@...iv.linux.org.uk, tglx@...utronix.de,
kstewart@...uxfoundation.org
Subject: Re: [PATCH] fs: fs_parser: avoid NULL param->string to kstrtouint
On Fri, Jul 19, 2019 at 08:43:29PM +0800, Yin Fengwei wrote:
> syzbot reported general protection fault in kstrtouint:
> https://lkml.org/lkml/2019/7/18/328
>
> >From the log, if the mount option is something like:
> fd,XXXXXXXXXXXXXXXXXXXX
>
> The default parameter (which has NULL param->string) will be
> passed to vfs_parse_fs_param. Finally, this NULL param->string
> is passed to kstrtouint and trigger NULL pointer access.
>
> Reported-by: syzbot+398343b7c1b1b989228d@...kaller.appspotmail.com
> Fixes: 71cbb7570a9a ("vfs: Move the subtype parameter into fuse")
>
> Signed-off-by: Yin Fengwei <nh26223.lmm@...il.com>
> ---
> fs/fs_parser.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/fs/fs_parser.c b/fs/fs_parser.c
> index d13fe7d797c2..578e6880ac67 100644
> --- a/fs/fs_parser.c
> +++ b/fs/fs_parser.c
> @@ -210,6 +210,10 @@ int fs_parse(struct fs_context *fc,
> case fs_param_is_fd: {
> switch (param->type) {
> case fs_value_is_string:
> + if (result->has_value) {
> + goto bad_value;
> + }
Always run checkpatch.pl so grumpy maintainers do not tell you to go run
checkpatch.pl :)
Powered by blists - more mailing lists