提交 3ad65cc8 编写于 作者: J Joe Thornber 提交者: Yang Yingliang

dm btree remove: fix use after free in rebalance_children()

stable inclusion
from linux-4.19.222
commit 293f957be5e39720778fb1851ced7f5fba6d51c3

--------------------------------

commit 1b8d2789 upstream.

Move dm_tm_unlock() after dm_tm_dec().

Cc: stable@vger.kernel.org
Signed-off-by: NJoe Thornber <ejt@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 67279faa
...@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s, ...@@ -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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册