]> git.baikalelectronics.ru Git - kernel.git/commit
binderfs: rework superblock destruction
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 23 Aug 2022 09:53:39 +0000 (11:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Sep 2022 14:18:49 +0000 (16:18 +0200)
commit1e2b819f236821e9338d826b395683f61760dc1b
tree6d8cb5c4bbb9f09467672410dec0ce8fadf8c8fe
parenta552caa3ea223215a2a934941407385e76e58617
binderfs: rework superblock destruction

So far we relied on
.put_super = binderfs_put_super()
to destroy info we stashed in sb->s_fs_info. This gave us the required ordering
between ->evict_inode() and sb->s_fs_info destruction.

But the current implementation of binderfs_fill_super() has a memory leak in
the rare circumstance that d_make_root() fails because ->put_super() is only
called when sb->s_root is initialized. Fix this by removing ->put_super() and
simply do all that work in binderfs_kill_super().

Reported-by: Dongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Link: https://lore.kernel.org/r/20220823095339.853371-1-brauner@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/android/binderfs.c