Skip to content

Commit

Permalink
dm btree remove: fix use after free in rebalance_children()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jthornber authored and gregkh committed Dec 22, 2021
1 parent f5187a9 commit 0e21e6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/persistent-data/dm-btree-remove.c
Expand Up @@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,

memcpy(n, dm_block_data(child),
dm_bm_block_size(dm_tm_get_bm(info->tm)));
dm_tm_unlock(info->tm, child);

dm_tm_dec(info->tm, dm_block_location(child));
dm_tm_unlock(info->tm, child);
return 0;
}

Expand Down

0 comments on commit 0e21e6c

Please sign in to comment.