diff options
author | Luo Meng <luomeng12@huawei.com> | 2022-11-29 03:48:50 +0100 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-11-30 19:29:34 +0100 |
commit | f50cb2cbabd6c4a60add93d72451728f86e4791c (patch) | |
tree | 2aa14a7c339f2932f2d1767272823561241118f8 /drivers/md | |
parent | dm cache: Fix UAF in destroy() (diff) | |
download | linux-f50cb2cbabd6c4a60add93d72451728f86e4791c.tar.xz linux-f50cb2cbabd6c4a60add93d72451728f86e4791c.zip |
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: 7eada909bfd7a ("dm: add integrity target")
Signed-off-by: Luo Meng <luomeng12@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-integrity.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index e97e9f97456d..1388ee35571e 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -4558,6 +4558,8 @@ static void dm_integrity_dtr(struct dm_target *ti) BUG_ON(!RB_EMPTY_ROOT(&ic->in_progress)); BUG_ON(!list_empty(&ic->wait_list)); + if (ic->mode == 'B') + cancel_delayed_work_sync(&ic->bitmap_flush_work); if (ic->metadata_wq) destroy_workqueue(ic->metadata_wq); if (ic->wait_wq) |