Skip to content

Commit d6f2589

Browse files
jankaratorvalds
authored andcommitted
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>
1 parent 632b06a commit d6f2589

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

fs/anon_inodes.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ static int __init anon_inode_init(void)
177177
{
178178
int error;
179179

180-
error = register_filesystem(&anon_inode_fs_type);
181-
if (error)
182-
goto err_exit;
183180
anon_inode_mnt = kern_mount(&anon_inode_fs_type);
184181
if (IS_ERR(anon_inode_mnt)) {
185182
error = PTR_ERR(anon_inode_mnt);

0 commit comments

Comments
 (0)