summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorLuo Meng <luomeng12@huawei.com>2022-11-29 05:48:49 +0300
committerMike Snitzer <snitzer@kernel.org>2022-11-30 21:29:34 +0300
commit6a459d8edbdbe7b24db42a5a9f21e6aa9e00c2aa (patch)
treec176d285fc80ba28da460c3912fe4fc1fcf952a3 /drivers/md
parente4b5957c6f749a501c464f92792f1c8e26b61a94 (diff)
downloadlinux-6a459d8edbdbe7b24db42a5a9f21e6aa9e00c2aa.tar.xz
dm cache: Fix UAF in destroy()
Dm_cache also has the same UAF problem when dm_resume() and dm_destroy() are concurrent. Therefore, cancelling timer again in destroy(). Cc: stable@vger.kernel.org Fixes: c6b4fcbad044e ("dm: add cache 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-cache-target.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 54a8d5c9a44e..624a6335c832 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1887,6 +1887,7 @@ static void destroy(struct cache *cache)
if (cache->prison)
dm_bio_prison_destroy_v2(cache->prison);
+ cancel_delayed_work_sync(&cache->waker);
if (cache->wq)
destroy_workqueue(cache->wq);