]> git.baikalelectronics.ru Git - kernel.git/commit
fix the struct mount leak in umount_tree()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 24 Jul 2019 16:45:46 +0000 (12:45 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 26 Jul 2019 11:59:06 +0000 (07:59 -0400)
commitf0efbf1e36f30180b75a90d3f9c82bdc8c3dba7a
treed7bbba61680553364deec2a068fe0da41f1905cc
parent936682a888e167bd392e7598c411117579b043a4
fix the struct mount leak in umount_tree()

We need to drop everything we remove from the tree, whether
mnt_has_parent() is true or not.  Usually the bug manifests as a slow
memory leak (leaked struct mount for initramfs); it becomes much more
visible in mount_subtree() users, such as btrfs.  There we leak
a struct mount for btrfs superblock being mounted, which prevents
fs shutdown on subsequent umount.

Fixes: ac1afdbb601b ("switch the remnants of releasing the mountpoint away from fs_pin")
Reported-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c