Skip to content

Commit f72ac1d

Browse files
committed
dm integrity: Fix UAF in dm_integrity_dtr()
Bugzilla: https://bugzilla.redhat.com/2162536 Upstream Status: kernel/git/torvalds/linux.git commit f50cb2c Author: Luo Meng <luomeng12@huawei.com> Date: Tue Nov 29 10:48:50 2022 +0800 dm integrity: Fix UAF in dm_integrity_dtr() Dm_integrity also has the same UAF problem when dm_resume() and dm_destroy() are concurrent. Therefore, cancelling timer again in dm_integrity_dtr(). Cc: stable@vger.kernel.org Fixes: 7eada90 ("dm: add integrity target") Signed-off-by: Luo Meng <luomeng12@huawei.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
1 parent 2387a2e commit f72ac1d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/md/dm-integrity.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4555,6 +4555,8 @@ static void dm_integrity_dtr(struct dm_target *ti)
45554555
BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress));
45564556
BUG_ON(!list_empty(&ic->wait_list));
45574557

4558+
if (ic->mode == 'B')
4559+
cancel_delayed_work_sync(&ic->bitmap_flush_work);
45584560
if (ic->metadata_wq)
45594561
destroy_workqueue(ic->metadata_wq);
45604562
if (ic->wait_wq)

0 commit comments

Comments
 (0)