Re: [syzbot] [ceph?] kernel BUG in __open_session
From: Edward Adam Davis
Date: Fri Sep 11 2026 - 09:06:14 EST
From: Edward Aadm Davis <eadavis@xxxxxxxx>
#syz test: upstream 50d05c7c76c9
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 72935f665f11..0f20d6c5e4bd 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -818,7 +818,11 @@ static struct ceph_fs_client *create_fs_client(struct ceph_mount_options *fsopt,
struct ceph_options *opt)
{
struct ceph_fs_client *fsc;
- int err;
+ int err, num_mon;
+
+ num_mon = opt->num_mon;
+ if (num_mon == 0 || num_mon > CEPH_MAX_MON)
+ return ERR_PTR(-EINVAL);
fsc = kzalloc_obj(*fsc);
if (!fsc) {