Re: [syzbot] [fs?] general protection fault in grab_requested_root

From: Qing Wang

Date: Fri Feb 13 2026 - 02:01:27 EST


#syz test

diff --git a/fs/namespace.c b/fs/namespace.c
index a67cbe42746d..8124f33d89a2 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -5678,13 +5678,17 @@ static int do_statmount(struct kstatmount *s, u64 mnt_id, u64 mnt_ns_id,

s->mnt = mnt_file->f_path.mnt;
ns = real_mount(s->mnt)->mnt_ns;
- if (!ns)
+ if (IS_ERR_OR_NULL(ns)) {
/*
* We can't set mount point and mnt_ns_id since we don't have a
* ns for the mount. This can happen if the mount is unmounted
* with MNT_DETACH.
*/
s->mask &= ~(STATMOUNT_MNT_POINT | STATMOUNT_MNT_NS_ID);
+ if (IS_ERR(ns))
+ return PTR_ERR(ns);
+ ns = NULL;
+ }
} else {
/* Has the namespace already been emptied? */
if (mnt_ns_id && mnt_ns_empty(ns))