Dm_cache also has the same UAF problem when dm_resume()
and dm_destroy() are concurrent.

Therefore, canceling timer again in destroy().

Fixes: c6b4fcbad044e (dm: add cache target)
Signed-off-by: Luo Meng <[email protected]>
---
 drivers/md/dm-cache-target.c | 1 +
 1 file changed, 1 insertion(+)

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);
 
-- 
2.31.1

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to