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 CE1FC46B5 for ; Mon, 16 Jan 2023 16:08:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 537A3C433EF; Mon, 16 Jan 2023 16:08:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673885293; bh=OPAaUWss3kggRsLZ9Cx/clbiMcyzfs3WLyn5KB1BSUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSefxa6e1rdUC87P2mTd/K4AN4yj4i5vvlZti84ENc4bEc9kQrRfI/eorS1RQidRG Fcai3OOEH/yeG9LoGBk2A2fX921U6pWuZ34wI7300ZXTiprQ1MpUFijMXPPP3zpdtN IbJyPbWkUs20uz7kuDVEJl7OzatAYc1+Ks1l2AvA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?=EC=A7=84=ED=98=B8?= , Jens Axboe Subject: [PATCH 5.10 62/64] io_uring/io-wq: free worker if task_work creation is canceled Date: Mon, 16 Jan 2023 16:52:09 +0100 Message-Id: <20230116154745.751671022@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154743.577276578@linuxfoundation.org> References: <20230116154743.577276578@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: Jens Axboe commit af82425c6a2d2f347c79b63ce74fca6dc6be157f upstream. If we cancel the task_work, the worker will never come into existance. As this is the last reference to it, ensure that we get it freed appropriately. Cc: stable@vger.kernel.org Reported-by: 진호 Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- io_uring/io-wq.c | 1 + 1 file changed, 1 insertion(+) --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -1217,6 +1217,7 @@ static void io_wq_cancel_tw_create(struc worker = container_of(cb, struct io_worker, create_work); io_worker_cancel_cb(worker); + kfree(worker); } }