]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: do not use extent after put_bh
authoryangerkun <yangerkun@huawei.com>
Wed, 28 Oct 2020 05:56:17 +0000 (13:56 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 28 Oct 2020 17:43:13 +0000 (13:43 -0400)
commit890bc2ca94989b27cd6195f78736a103e147b335
tree4f7d7c6bacdd04699ec030081195d84feacc0506
parentedd4e54a7993b18d3793ac9237ea494d918d8ef6
ext4: do not use extent after put_bh

ext4_ext_search_right() will read more extent blocks and call put_bh
after we get the information we need.  However, ret_ex will break this
and may cause use-after-free once pagecache has been freed.  Fix it by
copying the extent structure if needed.

Signed-off-by: yangerkun <yangerkun@huawei.com>
Link: https://lore.kernel.org/r/20201028055617.2569255-1-yangerkun@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/extents.c