diff options
| author | Yogesh Gaur <yogeshgaur.83@gmail.com> | 2026-09-11 19:01:10 +0530 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@gmail.com> | 2026-10-26 14:15:47 +0100 |
| commit | 6c82bff8561f4c20dc0113f81cb2f6e6e2b4cf70 (patch) | |
| tree | 784b2c6cc0f2d42a82c07fa2a9606d273a0de19d /include/linux/debugobjects.h | |
| parent | 94dbce2ae4fdb57bdb53ffa3456da777a5cfb981 (diff) | |
ceph: don't keep a mon_addr string that failed to parse
ceph_parse_mon_addr() stores the string in fsopt->mon_addr before handing
it to ceph_parse_mon_ips(), and then returns that function's error. So
after a mon_addr= that does not parse, fsconfig() reports the failure but
the mount context keeps the rejected string.
That matters because ceph_get_tree() uses fsopt->mon_addr as the "monitor
addresses were supplied" test:
if (fsopt->new_dev_syntax && !fsopt->mon_addr)
return invalfc(fc, "No monitor address");
Userspace is free to ignore the error from fsconfig(FSCONFIG_SET_STRING)
and go straight to FSCONFIG_CMD_CREATE. The check then passes on a value
that was rejected, and the mount continues with ceph_options::num_mon
still 0 - which is how syzbot reached the BUG_ON() in pick_new_mon()
fixed by the previous patch.
Parse first and commit only on success. A failed mon_addr= now leaves any
previously accepted value in place instead of replacing it with one that
does not parse.
Fixes: 7b19b4db5add ("ceph: new device mount syntax")
Reported-by: syzbot+1dbed5969931c19d3eb5@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=1dbed5969931c19d3eb5
Assisted-by: Cursor
Signed-off-by: Yogesh Gaur <yogeshgaur.83@gmail.com>
Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions
