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 84FC316DEC3 for ; Fri, 12 Jul 2024 12:28:10 +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=1720787290; cv=none; b=PHcxWxaWcQ68mx87hySDKO8pTRMO1bymnNDJ/FP4a74jheHzKOHaipWddogrWwtgJ+9QUfcf95PSIFfRxfTimkZvAmsAmxfPMaAgtcgJ6xK2vmZ2va5vWR32ulvu7KAUL7TaPzdcYzvBhxR8mEFQpk9Xhxw8qfftIjF4SNyobcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720787290; c=relaxed/simple; bh=xxupzFtySS3/eWFCpSM9RjHLmCRwXYNV8n/tvHtkINY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AWNsmHpxSjZ8wMg0o2FDlxtifAce0xBGqGi1NpyeVLSks4PdLrgMC6aitqE5R2MIsDvJWAJnl/qYGM1Vz/ju+4k6TPdS/ylKEZn/5RAVESSQylMfKecv+f6XMpdNaweRuuZDpyHrOBNe4jMWnxOOOHG8AyxrucDaHhmDf0uV1cw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IDkiCq6m; 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="IDkiCq6m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0985DC32782; Fri, 12 Jul 2024 12:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720787290; bh=xxupzFtySS3/eWFCpSM9RjHLmCRwXYNV8n/tvHtkINY=; h=From:To:Cc:Subject:Date:Reply-to:From; b=IDkiCq6mbulvGiTU+h4MWr2KFobzif+SDH2FfsiEqgN2Q/Oj7ZOwHj5UfiPpWTqAO jQRsHLuoqvgJrqjT00M6CdlJ9baqpfzOhiKbMdZir1Coez2RFc5T9sX5g3RDvToCu0 IZsmX9A60DCQoE0aJmyqNvJL66MpFNM0q16nge6A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-40922: io_uring/rsrc: don't lock while !TASK_RUNNING Date: Fri, 12 Jul 2024 14:27:20 +0200 Message-ID: <2024071213-CVE-2024-40922-461c@gregkh> X-Mailer: git-send-email 2.45.2 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=2844; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=xxupzFtySS3/eWFCpSM9RjHLmCRwXYNV8n/tvHtkINY=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkTFRVLb7zNfOB1aG9dmZO5Vdoxnt3xCsVrd3/9Y5K9u 26jzPf9HTEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRMgWGGWvDZ5ycGHqG71bf 31saMacqBLydGOZXHhKtm2LuuaX11EzvJm7b9wypSrsA 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/rsrc: don't lock while !TASK_RUNNING There is a report of io_rsrc_ref_quiesce() locking a mutex while not TASK_RUNNING, which is due to forgetting restoring the state back after io_run_task_work_sig() and attempts to break out of the waiting loop. do not call blocking ops when !TASK_RUNNING; state=1 set at [] prepare_to_wait+0xa4/0x380 kernel/sched/wait.c:237 WARNING: CPU: 2 PID: 397056 at kernel/sched/core.c:10099 __might_sleep+0x114/0x160 kernel/sched/core.c:10099 RIP: 0010:__might_sleep+0x114/0x160 kernel/sched/core.c:10099 Call Trace: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0xb4/0x940 kernel/locking/mutex.c:752 io_rsrc_ref_quiesce+0x590/0x940 io_uring/rsrc.c:253 io_sqe_buffers_unregister+0xa2/0x340 io_uring/rsrc.c:799 __io_uring_register io_uring/register.c:424 [inline] __do_sys_io_uring_register+0x5b9/0x2400 io_uring/register.c:613 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd8/0x270 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6f/0x77 The Linux kernel CVE team has assigned CVE-2024-40922 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 4ea15b56f081 and fixed in 6.6.35 with commit 0c9df3df0c88 Issue introduced in 6.4 with commit 4ea15b56f081 and fixed in 6.9.6 with commit 4429c6c77e17 Issue introduced in 6.4 with commit 4ea15b56f081 and fixed in 6.10-rc4 with commit 54559642b961 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-40922 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/rsrc.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/0c9df3df0c888d9ec8d11a68474a4aa04d371cff https://git.kernel.org/stable/c/4429c6c77e176a4c5aa7a3bbd1632f9fc0582518 https://git.kernel.org/stable/c/54559642b96116b45e4b5ca7fd9f7835b8561272