Skip to content

Commit

Permalink
fs: Avoid userspace mounting anon_inodefs filesystem
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jankara authored and torvalds committed Mar 26, 2014
1 parent 632b06a commit d6f2589
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/anon_inodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@ static int __init anon_inode_init(void)
{
int error;

error = register_filesystem(&anon_inode_fs_type);
if (error)
goto err_exit;
anon_inode_mnt = kern_mount(&anon_inode_fs_type);
if (IS_ERR(anon_inode_mnt)) {
error = PTR_ERR(anon_inode_mnt);
Expand Down

0 comments on commit d6f2589

Please sign in to comment.