apparmorfs: fix use-after-free on symlink traversal
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 10 Apr 2019 18:04:34 +0000 (14:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 May 2019 16:23:42 +0000 (18:23 +0200)
commitb21ca2769b0f79840749674b98b3e3b7f5730e17
tree1c7a8818b8ff97697458c39a0dccda7530940894
parent9a0467e1f67155c126e5857b1d3ae2ac8b009aa5
apparmorfs: fix use-after-free on symlink traversal

[ Upstream commit f51dcd0f621caac5380ce90fbbeafc32ce4517ae ]

symlink body shouldn't be freed without an RCU delay.  Switch apparmorfs
to ->destroy_inode() and use of call_rcu(); free both the inode and symlink
body in the callback.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/apparmor/apparmorfs.c