f2fs: fix potential use-after-free issue
authorChao Yu <yuchao0@huawei.com>
Thu, 23 Apr 2020 09:57:33 +0000 (17:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:43 +0000 (17:48 +0200)
commitbec32a54a4de62b46466f4da1beb9ddd42db81b8
treef2f957dd51578f0dc07c4d8cc66a2e14ab4a4895
parent84fb7a793ab63102492d12819a54bddaa1d69888
f2fs: fix potential use-after-free issue

[ Upstream commit f3494345ce9999624b36109252a4bf5f00e51a46 ]

In error path of f2fs_read_multi_pages(), it should let last referrer
release decompress io context memory, otherwise, other referrer will
cause use-after-free issue.

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/data.c