fuse: fix UAF in rcu pathwalks

[ Upstream commit 053fc4f755 ]

->permission(), ->get_link() and ->inode_get_acl() might dereference
->s_fs_info (and, in case of ->permission(), ->s_fs_info->fc->user_ns
as well) when called from rcu pathwalk.

Freeing ->s_fs_info->fc is rcu-delayed; we need to make freeing ->s_fs_info
and dropping ->user_ns rcu-delayed too.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Al Viro 2023-09-28 00:19:39 -04:00 • committed by Greg Kroah-Hartman
commit bfbab62ca6
3 changed files with 13 additions and 6 deletions