Re: [syzbot] [bcachefs?] BUG: unable to handle kernel paging request in bch2_opt_to_text
From: Edward Adam Davis
Date: Thu Sep 19 2024 - 11:18:07 EST
The format of the 'name=value' key value pair included in the options is
incorrect, if only name is present.
#syz test
diff --git a/fs/bcachefs/opts.c b/fs/bcachefs/opts.c
index e10fc1da71b1..5616dc8570fa 100644
--- a/fs/bcachefs/opts.c
+++ b/fs/bcachefs/opts.c
@@ -472,6 +472,12 @@ int bch2_parse_one_mount_opt(struct bch_fs *c, struct bch_opts *opts,
u64 v;
int ret, id;
+ if (!val) {
+ pr_err("Bad mount option, value is NULL");
+ ret = -BCH_ERR_option_value;
+ goto out;
+ }
+
id = bch2_mount_opt_lookup(name);
/* Check for the form "noopt", negation of a boolean opt: */