Skip to content

Commit 0e21e6c

Browse files
jthornbergregkh
authored andcommitted
dm btree remove: fix use after free in rebalance_children()
commit 1b8d278 upstream. Move dm_tm_unlock() after dm_tm_dec(). Cc: stable@vger.kernel.org Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f5187a9 commit 0e21e6c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/md/persistent-data/dm-btree-remove.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,
423423

424424
memcpy(n, dm_block_data(child),
425425
dm_bm_block_size(dm_tm_get_bm(info->tm)));
426-
dm_tm_unlock(info->tm, child);
427426

428427
dm_tm_dec(info->tm, dm_block_location(child));
428+
dm_tm_unlock(info->tm, child);
429429
return 0;
430430
}
431431

0 commit comments

Comments
 (0)