From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BD396FA0 for ; Mon, 16 Jan 2023 17:13:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0A1FC433EF; Mon, 16 Jan 2023 17:13:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673889237; bh=8sWsOqejoezgnhqD5YJS9mEOBp86fgGRNlJtUvgepmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RvgIpROtcl8rwWLO8G4Nnn9cg/9L8qCU7TyT/26M0PyD4m17jzisjncEKtpJI3+W+ Mdy7wcFEIuKLzZyvr9EOHhBkwQTcO/s1B6OeR0LLqBneNOLDmMYObGOLvj/pw/E87P urlde8QXot3GH1VNl2sb8k3Y0kbXHNHKU7b8mt74= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Luo Meng , Mike Snitzer Subject: [PATCH 4.14 280/338] dm cache: Fix UAF in destroy() Date: Mon, 16 Jan 2023 16:52:33 +0100 Message-Id: <20230116154833.298596042@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154820.689115727@linuxfoundation.org> References: <20230116154820.689115727@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Luo Meng 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 Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-cache-target.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/dm-cache-target.c +++ b/drivers/md/dm-cache-target.c @@ -2034,6 +2034,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);