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.

fs: Avoid userspace mounting anon_inodefs filesystem

anon_inodefs filesystem is a kernel internal filesystem userspace
shouldn't mess with. Remove registration of it so userspace cannot
even try to mount it (which would fail anyway because the filesystem is
MS_NOUSER).

This fixes an oops triggered by trinity when it tried mounting
anon_inodefs which overwrote anon_inode_inode pointer while other CPU
has been in anon_inode_getfile() between ihold() and d_instantiate().
Thus effectively creating dentry pointing to an inode without holding a
reference to it.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jan Kara and committed by
Linus Torvalds
d6f2589a 632b06aa

-3
-3
fs/anon_inodes.c
··· 177 177 { 178 178 int error; 179 179 180 - error = register_filesystem(&anon_inode_fs_type); 181 - if (error) 182 - goto err_exit; 183 180 anon_inode_mnt = kern_mount(&anon_inode_fs_type); 184 181 if (IS_ERR(anon_inode_mnt)) { 185 182 error = PTR_ERR(anon_inode_mnt);