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 966306FBB for ; Tue, 10 Jan 2023 18:25:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E46BDC433D2; Tue, 10 Jan 2023 18:25:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673375128; bh=LhWl0omNmVi7EgqXmPg+hdgSg1MWw1rP7Yn7OECaM/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xyypc0LIr5rQ3u0225QmjGMBY/bAYrn6a6lugxepSbiREzGEmL33Dfq2W0nThKJ5y L0Uw8t1qZKQeIyvT5XIMT5lrNRtnBMv8hTNxVR9zjeORaEhmN7q8e9pY3jIIz+S9n5 6dNnND4lmyMphgBNl791N6S6/c4NImPbVJ5kLbJ8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Luo Meng , Mike Snitzer Subject: [PATCH 5.15 087/290] dm clone: Fix UAF in clone_dtr() Date: Tue, 10 Jan 2023 19:02:59 +0100 Message-Id: <20230110180034.606851165@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110180031.620810905@linuxfoundation.org> References: <20230110180031.620810905@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 e4b5957c6f749a501c464f92792f1c8e26b61a94 upstream. Dm_clone also has the same UAF problem when dm_resume() and dm_destroy() are concurrent. Therefore, cancelling timer again in clone_dtr(). Cc: stable@vger.kernel.org Fixes: 7431b7835f554 ("dm: add clone target") Signed-off-by: Luo Meng Signed-off-by: Mike Snitzer Signed-off-by: Greg Kroah-Hartman --- drivers/md/dm-clone-target.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/md/dm-clone-target.c +++ b/drivers/md/dm-clone-target.c @@ -1959,6 +1959,7 @@ static void clone_dtr(struct dm_target * mempool_exit(&clone->hydration_pool); dm_kcopyd_client_destroy(clone->kcopyd_client); + cancel_delayed_work_sync(&clone->waker); destroy_workqueue(clone->wq); hash_table_exit(clone); dm_clone_metadata_close(clone->cmd);