From: syzbot <syzbot+37186860aa7812b331d5@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] general protection fault in prt_str
Date: Mon, 16 Sep 2024 14:11:26 -0700 [thread overview]
Message-ID: <00000000000016ba66062243042e@google.com> (raw)
In-Reply-To: <000000000000b5ca0f06223dc3b7@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: general protection fault in prt_str
Author: djahchankoike@gmail.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@gmail.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
next prev parent reply other threads:[~2024-09-16 21:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 14:55 [syzbot] [bcachefs?] general protection fault in prt_str syzbot
2024-09-16 19:26 ` [syzbot] general protection fault in ptr_str syzbot
2024-09-16 21:11 ` syzbot [this message]
2024-09-21 22:53 ` [syzbot] general protection fault in prt_str syzbot
2024-09-22 0:26 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=00000000000016ba66062243042e@google.com \
--to=syzbot+37186860aa7812b331d5@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.