]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: avoid drop reference to iloc.bh twice
authorPan Bian <bianpan2016@163.com>
Thu, 25 Apr 2019 15:44:15 +0000 (11:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 May 2019 05:38:51 +0000 (07:38 +0200)
commit310aea022196a29485b2bf79c7516210a4fcddad
treeecfb0f3b19a44bc75d0661bd556570945727422b
parent7db933229f647f487acbca280c5df0a219d94a3b
ext4: avoid drop reference to iloc.bh twice

commit 8c380ab4b7b59c0c602743810be1b712514eaebc upstream.

The reference to iloc.bh has been dropped in ext4_mark_iloc_dirty.
However, the reference is dropped again if error occurs during
ext4_handle_dirty_metadata, which may result in use-after-free bugs.

Fixes: fb265c9cb49e("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/resize.c