jffs2: fix use-after-free on symlink traversal
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 26 Mar 2019 01:39:50 +0000 (01:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2019 05:19:09 +0000 (07:19 +0200)
commitff250f4c804f342695c35e1a39b63666086f2cab
tree25ce4aa26379cd67aa5f87aa9c2ca9fe69f74b7d
parentdc498ade714d878cbb2a51cbd06b41d0a7a60531
jffs2: fix use-after-free on symlink traversal

[ Upstream commit 4fdcfab5b5537c21891e22e65996d4d0dd8ab4ca ]

free the symlink body after the same RCU delay we have for freeing the
struct inode itself, so that traversal during RCU pathwalk wouldn't step
into freed memory.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/jffs2/readinode.c
fs/jffs2/super.c