Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

statmount: Fix the null-ptr-deref in do_statmount()

If the mount is internal, it's mnt_ns will be MNT_NS_INTERNAL, which is
defined as ERR_PTR(-EINVAL). So, in the do_statmount(), need to check ns
of mount by IS_ERR() and return.

Fixes: 0e5032237ee5 ("statmount: accept fd as a parameter")
Reported-by: syzbot+9e03a9535ea65f687a44@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/698e287a.a70a0220.2c38d7.009e.GAE@google.com/
Signed-off-by: Qing Wang <wangqing7171@gmail.com>
Link: https://patch.msgid.link/20260213103006.2472569-1-wangqing7171@gmail.com
Reviewed-by: Bhavik Sachdev <b.sachdev1904@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Qing Wang and committed by
Christian Brauner
81f16c97 9eed043d

+2
+2
fs/namespace.c
··· 5678 5678 5679 5679 s->mnt = mnt_file->f_path.mnt; 5680 5680 ns = real_mount(s->mnt)->mnt_ns; 5681 + if (IS_ERR(ns)) 5682 + return PTR_ERR(ns); 5681 5683 if (!ns) 5682 5684 /* 5683 5685 * We can't set mount point and mnt_ns_id since we don't have a