[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00000000000016ba66062243042e@google.com>
Date: Mon, 16 Sep 2024 14:11:26 -0700
From: syzbot <syzbot+37186860aa7812b331d5@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [syzbot] general protection fault in prt_str
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org.
***
Subject: general protection fault in prt_str
Author: djahchankoike@...il.com
#syz test
syzbot reported a null ptr deref when printing mount options [1].
This happens because syzbot can pass options such as ',appraise,'
with no value associated with it, since it is a unknown option and
is not in the 'noopt' form it does not check for null values.
Change so that unknown options with invalid values are reported.
Signed-off-by: Diogo Jahchan Koike <djahchankoike@...il.com>
---
fs/bcachefs/opts.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index e10fc1da71b1..1ccaed5c340b 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -482,6 +482,10 @@ int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts,
val = "0";
}
+ /* Unknown options with invalid values are reported */
+ if (id < 0 && !val)
+ goto bad_val;
+
/* Unknown options are ignored: */
if (id < 0)
return 0;
--
2.43.0
Powered by blists - more mailing lists