dm cache: Fix UAF in destroy()
authorLuo Meng <luomeng12@huawei.com>
Tue, 29 Nov 2022 02:48:49 +0000 (10:48 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 08:26:37 +0000 (09:26 +0100)
commit993406104d2b28fe470126a062ad37a1e21e792e
tree8aca1c56d782df52e65f0bd4b376f095a57ce68b
parent550a4fac7ecfee5bac6a0dd772456ca62fb72f46
dm cache: Fix UAF in destroy()

commit 6a459d8edbdbe7b24db42a5a9f21e6aa9e00c2aa upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-target.c