diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-03-26 04:39:50 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-08 08:20:49 +0300 |
commit | f9c04ee063108bfe16a7232429402866aa0ddd26 (patch) | |
tree | 32d1b44c0608a78cfbf9a87dbba4b554cc03e28d /fs/jffs2/readinode.c | |
parent | 87f74cd974d69fb33ec00dca26f7655eb0569a79 (diff) | |
download | linux-f9c04ee063108bfe16a7232429402866aa0ddd26.tar.xz |
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>
Diffstat (limited to 'fs/jffs2/readinode.c')
-rw-r--r-- | fs/jffs2/readinode.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 389ea53ea487..bccfc40b3a74 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c @@ -1414,11 +1414,6 @@ void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f) jffs2_kill_fragtree(&f->fragtree, deleted?c:NULL); - if (f->target) { - kfree(f->target); - f->target = NULL; - } - fds = f->dents; while(fds) { fd = fds; |