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 8D6552594AD for ; Sun, 29 Dec 2024 08:43:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735461788; cv=none; b=kRxm5wavS82z8fwoDisR2nFaKwaIkCFFrfBQ7W+GEjOEcs1AbBYbHzujK2ebChYn0nqj3BQxkVTiIayqKqakrJtm2Ri+6CLxiQDL2wLh/a8kXH90ZRK10B98VI82sKJtU5Cjf8I547fDe6Xsx0IkqV0bVH7U6xg8+61ZikqOrz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735461788; c=relaxed/simple; bh=wz1ZGr7T/42Fc7DmsG9dqEvJ6ecHek9A0K1gjd1kf+Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=HYVJ9YvUJicDOVp/hIN5jag3ZGh4eaQgh7y+QP0VMWfeJ7mg1l/lKFZ9NqVZu/oFylkxNbrvhen1xFsm+1hE1PBPbCuwmxqbzLDs3kq98rU5Ku1qjSTE+R+DNNUzvvf5SKMlQ74F5hSVVplJDCdvbDiU7x0TGEKshPy1Hj/ljPY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VV9Fcl4i; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VV9Fcl4i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C9A0C4CED1; Sun, 29 Dec 2024 08:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735461788; bh=wz1ZGr7T/42Fc7DmsG9dqEvJ6ecHek9A0K1gjd1kf+Q=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VV9Fcl4iSP8vCs9fnK5tdX7fN2BEbSyigXp/jMUXciTjsl/MTbJanqhLw8Eh4+DRr wkbTDteA44Qg2DDTSxZbig9dMKi77oaAZ9A59HlFNFRgBqHdzzA5216hw26WcNtYR+ dHfSTm8BLAnS2gVs1ssrI1bGJibUXOg31gf0LYZU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56709: io_uring: check if iowq is killed before queuing Date: Sun, 29 Dec 2024 09:42:19 +0100 Message-ID: <2024122918-CVE-2024-56709-655c@gregkh> X-Mailer: git-send-email 2.47.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=2726; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=wz1ZGr7T/42Fc7DmsG9dqEvJ6ecHek9A0K1gjd1kf+Q=; b=owGbwMvMwCRo6H6F97bub03G02pJDOmF3Fn5wYfiPvE/Dnu6K6n7Is9xPdnCHulVZce3T/4nE Z0vG9neEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNhus8wVzREKsfa6L5b+I47 05s+BKVvldOtZ1iwPWvb36z/FfxqKzmUey1v/7bsDLYBAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: io_uring: check if iowq is killed before queuing task work can be executed after the task has gone through io_uring termination, whether it's the final task_work run or the fallback path. In this case, task work will find ->io_wq being already killed and null'ed, which is a problem if it then tries to forward the request to io_queue_iowq(). Make io_queue_iowq() fail requests in this case. Note that it also checks PF_KTHREAD, because the user can first close a DEFER_TASKRUN ring and shortly after kill the task, in which case ->iowq check would race. The Linux kernel CVE team has assigned CVE-2024-56709 to this issue. Affected and fixed versions =========================== Issue introduced in 5.14 with commit 773af69121ecc6c53d192661af8d53bb3db028ae and fixed in 6.1.122 with commit 534d59ab38010aada88390db65985e65d0de7d9e Issue introduced in 5.14 with commit 773af69121ecc6c53d192661af8d53bb3db028ae and fixed in 6.6.68 with commit 2ca94c8de36091067b9ce7527ae8db3812d38781 Issue introduced in 5.14 with commit 773af69121ecc6c53d192661af8d53bb3db028ae and fixed in 6.12.7 with commit 4f95a2186b7f2af09331e1e8069bcaf34fe019cf Issue introduced in 5.14 with commit 773af69121ecc6c53d192661af8d53bb3db028ae and fixed in 6.13-rc4 with commit dbd2ca9367eb19bc5e269b8c58b0b1514ada9156 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2024-56709 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: io_uring/io_uring.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/534d59ab38010aada88390db65985e65d0de7d9e https://git.kernel.org/stable/c/2ca94c8de36091067b9ce7527ae8db3812d38781 https://git.kernel.org/stable/c/4f95a2186b7f2af09331e1e8069bcaf34fe019cf https://git.kernel.org/stable/c/dbd2ca9367eb19bc5e269b8c58b0b1514ada9156