1 ext4: avoid drop reference to iloc.bh twice
3 From: Pan Bian <bianpan2016@163.com>
5 The reference to iloc.bh has been dropped in ext4_mark_iloc_dirty.
6 However, the reference is dropped again if error occurs during
7 ext4_handle_dirty_metadata, which may result in use-after-free bugs.
9 Fixes: fb265c9cb49e("ext4: add ext4_sb_bread() to disambiguate ENOMEM
12 Signed-off-by: Pan Bian <bianpan2016@163.com>
13 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14 Reviewed-by: Jan Kara <jack@suse.cz>
16 fs/ext4/resize.c | 1 +
17 1 file changed, 1 insertion(+)
19 diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
20 index e7ae26e..4d5c0fc 100644
21 --- a/fs/ext4/resize.c
22 +++ b/fs/ext4/resize.c
23 @@ -874,6 +874,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
24 err = ext4_handle_dirty_metadata(handle, NULL, gdb_bh);
26 ext4_std_error(sb, err);