Re: [syzbot] Re: [syzbot] [overlayfs?] general protection fault in clone_private_mount

From: syzbot
Date: Fri Feb 07 2025 - 02:02:36 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: Re: [syzbot] [overlayfs?] general protection fault in clone_private_mount
Author: lizhi.xu@xxxxxxxxxxxxx

#syz test

diff --git a/fs/namespace.c b/fs/namespace.c
index 1314f11ed961..8e2ff3dbab58 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -2421,6 +2421,9 @@ struct vfsmount *clone_private_mount(const struct path *path)
if (!check_mnt(old_mnt))
return ERR_PTR(-EINVAL);
} else {
+ if (!is_mounted(&old_mnt->mnt))
+ return ERR_PTR(-EINVAL);
+
/* Make sure this isn't something purely kernel internal. */
if (!is_anon_ns(old_mnt->mnt_ns))
return ERR_PTR(-EINVAL);