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 D35302419E1 for ; Wed, 15 Jan 2025 13:07:39 +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=1736946459; cv=none; b=TivNimMK34w81aEHErSudpJ+GR8XKIcmjSaEMOXPpu9FoxnbDJ7aTzvsNT/F5GEz0LdwZeBwpC9BIWVp3UOU3g9nZKiejHJXLqh/grDtHYfHoZYe+h2yjRsSFiMJuaLKM6Dca2G3BfFLtF9k7DnveX80U7Ju0gNlhy1I+89F0Q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736946459; c=relaxed/simple; bh=omj9xQt+q2PUkNaIb8EFC68omIiTir+YEFdNWJ63CnQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NPbVVz9GMyzmBmpyN6Hptau4xLVWi+iCWW93CSpcUqIO3GABE2p6yG9ZuBqniRif+kQO7cRhujBBEiYwWk9s0bdXD4lV3HUsNO8ito5RBXRFRMNAx05d5YAojnl5uTM+bTPNhIUTF/V7CleFLzyocq8j8d+6j8f3STXbUW3WTis= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Cr4LwSHM; 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="Cr4LwSHM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDFB1C4CEDF; Wed, 15 Jan 2025 13:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736946459; bh=omj9xQt+q2PUkNaIb8EFC68omIiTir+YEFdNWJ63CnQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Cr4LwSHMEyogCp0yE3wOkdfu8DncYOUgRTbLclt+Sl0GoAUq0lJfCvMD61KIw9yN8 HEy+lPZdW77v28lYyP0MHhIc2W98fMl5MDPTpTcG6ryHarzvD9uiccg05Mj4oAQzSe Ov1ht0cyhlf/w/BQ5rtNMA6IMfFRJZDF+C9DL6MU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21630: io_uring/net: always initialize kmsg->msg.msg_inq upfront Date: Wed, 15 Jan 2025 14:06:28 +0100 Message-ID: <2025011517-CVE-2025-21630-7665@gregkh> X-Mailer: git-send-email 2.48.0 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=3479; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=omj9xQt+q2PUkNaIb8EFC68omIiTir+YEFdNWJ63CnQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOntm042ceWVvzV11PlpaBF1UTjg0Rr7pDcvDC6yzrSTX n3t4uyqjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIqAXDXIE9XMyVXJZTJVr/ /WjsD2K9l2WwmGHB/PS7WbZK9kd97jZNM3/zPibm+w0VAA== 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/net: always initialize kmsg->msg.msg_inq upfront syzbot reports that ->msg_inq may get used uinitialized from the following path: BUG: KMSAN: uninit-value in io_recv_buf_select io_uring/net.c:1094 [inline] BUG: KMSAN: uninit-value in io_recv+0x930/0x1f90 io_uring/net.c:1158 io_recv_buf_select io_uring/net.c:1094 [inline] io_recv+0x930/0x1f90 io_uring/net.c:1158 io_issue_sqe+0x420/0x2130 io_uring/io_uring.c:1740 io_queue_sqe io_uring/io_uring.c:1950 [inline] io_req_task_submit+0xfa/0x1d0 io_uring/io_uring.c:1374 io_handle_tw_list+0x55f/0x5c0 io_uring/io_uring.c:1057 tctx_task_work_run+0x109/0x3e0 io_uring/io_uring.c:1121 tctx_task_work+0x6d/0xc0 io_uring/io_uring.c:1139 task_work_run+0x268/0x310 kernel/task_work.c:239 io_run_task_work+0x43a/0x4a0 io_uring/io_uring.h:343 io_cqring_wait io_uring/io_uring.c:2527 [inline] __do_sys_io_uring_enter io_uring/io_uring.c:3439 [inline] __se_sys_io_uring_enter+0x204f/0x4ce0 io_uring/io_uring.c:3330 __x64_sys_io_uring_enter+0x11f/0x1a0 io_uring/io_uring.c:3330 x64_sys_call+0xce5/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:427 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f and it is correct, as it's never initialized upfront. Hence the first submission can end up using it uninitialized, if the recv wasn't successful and the networking stack didn't honor ->msg_get_inq being set and filling in the output value of ->msg_inq as requested. Set it to 0 upfront when it's allocated, just to silence this KMSAN warning. There's no side effect of using it uninitialized, it'll just potentially cause the next receive to use a recv value hint that's not accurate. The Linux kernel CVE team has assigned CVE-2025-21630 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit c6f32c7d9e09bf1368447e9a29e869193ecbb756 and fixed in 6.12.9 with commit 127c280067167beb88461cd930f7c7a4bb3c7239 Issue introduced in 6.10 with commit c6f32c7d9e09bf1368447e9a29e869193ecbb756 and fixed in 6.13-rc6 with commit c6e60a0a68b7e6b3c7e33863a16e8e88ba9eee6f 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-2025-21630 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/net.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/127c280067167beb88461cd930f7c7a4bb3c7239 https://git.kernel.org/stable/c/c6e60a0a68b7e6b3c7e33863a16e8e88ba9eee6f