mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 07:29:42 -05:00
vfs: fsmount: add missing mntget()
sys_fsmount() needs to take a reference to the new mount when adding it
to the anonymous mount namespace. Otherwise the filesystem can be
unmounted while it's still in use, as found by syzkaller.
Reported-by: Mark Rutland <[email protected]>
Reported-by: [email protected]
Reported-by: [email protected]
Fixes: 93766fbd26 ("vfs: syscall: Add fsmount() to create a mount for a superblock")
Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
9e0babf2c0
commit
1b0b9cc8d3
1 changed files with 1 additions and 0 deletions
|
|
@ -3445,6 +3445,7 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
|
|||
ns->root = mnt;
|
||||
ns->mounts = 1;
|
||||
list_add(&mnt->mnt_list, &ns->list);
|
||||
mntget(newmount.mnt);
|
||||
|
||||
/* Attach to an apparent O_PATH fd with a note that we need to unmount
|
||||
* it, not just simply put it.
|
||||
|
|
|
|||
Loading…
Reference in a new issue