mirror of
https://github.com/torvalds/linux.git
synced 2026-06-06 21:45:45 +02:00
dm btree remove: fix use after free in rebalance_children()
commit 1b8d2789da 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>
This commit is contained in:
parent
f5187a9d52
commit
0e21e6cd5e
|
|
@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,
|
||||||
|
|
||||||
memcpy(n, dm_block_data(child),
|
memcpy(n, dm_block_data(child),
|
||||||
dm_bm_block_size(dm_tm_get_bm(info->tm)));
|
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_dec(info->tm, dm_block_location(child));
|
||||||
|
dm_tm_unlock(info->tm, child);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user