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 AFA151DE2A1 for ; Mon, 6 Jan 2025 16:21:33 +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=1736180493; cv=none; b=Yv6Tx5fx2S9SImHkJk79bmaD7JwVtRnTEHJmJGCdSbuPqYVdqwgFsrG2CUm5nfyl/RfpQJjdhL2uF/ef6R7eM4svy6Ifdy08REFs6ncN1JpXCLr9rF6k/irmSzVm3dNkVX3LtSkCOpjmdVH0H/54xYu8PSGmkYrkxjxm+rop3jA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736180493; c=relaxed/simple; bh=WIgfH2WY7Jo6b2ocw0bwC2VD+DzVqtdz8ixmL/j+5lw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=U81AFOCM/Am+Oq9ksBbwfa8NeiKQpTWbS9NQFU/liLtJrqzASPor7gZPJZ8Ma2O0ksIt0aIUcxaf8PkHDEUyLvKgHHNjxef4WV5sbJob1W+tzsfXDOV8+MsKI3PqmKzK5HU7T+JPllX8dTWdofLfN8Y8r0X/6a/6QTlPfGyRfdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XtYnvl/c; 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="XtYnvl/c" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5BADC4CED2; Mon, 6 Jan 2025 16:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736180493; bh=WIgfH2WY7Jo6b2ocw0bwC2VD+DzVqtdz8ixmL/j+5lw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XtYnvl/cg2y/s0oOpUSnyEwjnXStPCCXf55+oOKlnDYqKniTtUYie8LAb1RYWPmzJ 451v3KEUEzY9BnBFdEW8ylUFhKsAnk6jS31zfQq1GVJFXJc8gX+Ej5mDMR6M3eHoDC wUsGAac284pmpu+EIxxIR6MBn4BmTVVorjGPWekM= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56762: io_uring/sqpoll: fix sqpoll error handling races Date: Mon, 6 Jan 2025 17:20:56 +0100 Message-ID: <2025010654-CVE-2024-56762-9a9f@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=2862; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=WIgfH2WY7Jo6b2ocw0bwC2VD+DzVqtdz8ixmL/j+5lw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk1TM9/zy1M2T9Nj0XGZHJvZmcJZ7LEQ5bdMhI1ly5Pm /zx+e+gjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhI2zKGuWLrNt35tzDxTcmO /8/fHOirXmmd8JVhwe7fe+dy2nw0NKsWsc280Xria2vbBQA= 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/sqpoll: fix sqpoll error handling races BUG: KASAN: slab-use-after-free in __lock_acquire+0x370b/0x4a10 kernel/locking/lockdep.c:5089 Call Trace: ... _raw_spin_lock_irqsave+0x3d/0x60 kernel/locking/spinlock.c:162 class_raw_spinlock_irqsave_constructor include/linux/spinlock.h:551 [inline] try_to_wake_up+0xb5/0x23c0 kernel/sched/core.c:4205 io_sq_thread_park+0xac/0xe0 io_uring/sqpoll.c:55 io_sq_thread_finish+0x6b/0x310 io_uring/sqpoll.c:96 io_sq_offload_create+0x162/0x11d0 io_uring/sqpoll.c:497 io_uring_create io_uring/io_uring.c:3724 [inline] io_uring_setup+0x1728/0x3230 io_uring/io_uring.c:3806 ... Kun Hu reports that the SQPOLL creating error path has UAF, which happens if io_uring_alloc_task_context() fails and then io_sq_thread() manages to run and complete before the rest of error handling code, which means io_sq_thread_finish() is looking at already killed task. Note that this is mostly theoretical, requiring fault injection on the allocation side to trigger in practice. The Linux kernel CVE team has assigned CVE-2024-56762 to this issue. Affected and fixed versions =========================== Fixed in 6.1.123 with commit 6237331361711810d8f2e3fbfe2f7a6f9548f5e0 Fixed in 6.6.69 with commit 80120bb4eef7848d5aa3b1a0cd88367cd05fbe03 Fixed in 6.12.8 with commit 8e8494c83cf73168118587e9567e4f7e50ce4fd8 Fixed in 6.13-rc5 with commit e33ac68e5e21ec1292490dfe061e75c0dbdd3bd4 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-56762 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/sqpoll.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/6237331361711810d8f2e3fbfe2f7a6f9548f5e0 https://git.kernel.org/stable/c/80120bb4eef7848d5aa3b1a0cd88367cd05fbe03 https://git.kernel.org/stable/c/8e8494c83cf73168118587e9567e4f7e50ce4fd8 https://git.kernel.org/stable/c/e33ac68e5e21ec1292490dfe061e75c0dbdd3bd4