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 39C9B2D63F1 for ; Fri, 4 Jul 2025 13:42: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=1751636554; cv=none; b=KmSYvfW7UkLOI5pc1vpNw3m62rnnuiaLZbJ//xJzTt/jxfXr+QK70ov65CU6o/5Rf8H2dREG9QrXa6DCAcoF1WLA8i3hm77vHZgQllNTUq4MSeo2wOSf+wvEv3l8DXhGrvRBmKMsXagew+8L5FuxxyDYm4Uz2P9or+stZIaA/Fs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751636554; c=relaxed/simple; bh=lxeGocdWFaDo2RVQg7VjJ/SeOKrlNZBTy0k44jE6CR4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=sJm8AI1PNw3KKHRiGrLeGM2cS+/MbdxqmkWixwCIT/b2YaWG0Az3L7fGp2DAJiv73haddnIrHjT7NFtjdLiCoLNPx1OEfeQW5esgiebAUcbnpNtwYtKskCon5AILTMhJF8j+uG2g1H0UvLfeFhuaL85cNt+XSP2a1vJJ0SY0dys= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=upar+ONr; 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="upar+ONr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7345EC4CEEB; Fri, 4 Jul 2025 13:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751636553; bh=lxeGocdWFaDo2RVQg7VjJ/SeOKrlNZBTy0k44jE6CR4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=upar+ONrnVw5IIZkAsPzsfhuRP3ikwf7it9LH50+pkrtDIdg9o3/vKmbjEvs0c090 kk8zOKuLg8kqUgO21XhXI11DLwEAlNf2cOXpYAp8AxudEZP/4LFo+Fz/UBJRoNt1pb zrT7MJ4UFKJ2KVcwfpFOYum1BwR4HKoMfLIHcB6o= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38196: io_uring/rsrc: validate buffer count with offset for cloning Date: Fri, 4 Jul 2025 15:37:25 +0200 Message-ID: <2025070416-CVE-2025-38196-ba59@gregkh> X-Mailer: git-send-email 2.50.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=4582; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=UEOxBKI+f7j5eRR72R6hZ5M+3o7f2b0MJPfoqXgFQ8o=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnpN3kY/J/rnQzzSbRg2bf1xq/bl29VnnuaL7w9Yq/T+ 7p5u26t7YhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEN4eIUgImcmsKwoOXP1TXTebuMTrxK is16yn4t9pYFM8OCedrGH6wuiijnXFhsk5Rk2VDxVy4GAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: io_uring/rsrc: validate buffer count with offset for cloning syzbot reports that it can trigger a WARN_ON() for kmalloc() attempt that's too big: WARNING: CPU: 0 PID: 6488 at mm/slub.c:5024 __kvmalloc_node_noprof+0x520/0x640 mm/slub.c:5024 Modules linked in: CPU: 0 UID: 0 PID: 6488 Comm: syz-executor312 Not tainted 6.15.0-rc7-syzkaller-gd7fa1af5b33e #0 PREEMPT Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __kvmalloc_node_noprof+0x520/0x640 mm/slub.c:5024 lr : __do_kmalloc_node mm/slub.c:-1 [inline] lr : __kvmalloc_node_noprof+0x3b4/0x640 mm/slub.c:5012 sp : ffff80009cfd7a90 x29: ffff80009cfd7ac0 x28: ffff0000dd52a120 x27: 0000000000412dc0 x26: 0000000000000178 x25: ffff7000139faf70 x24: 0000000000000000 x23: ffff800082f4cea8 x22: 00000000ffffffff x21: 000000010cd004a8 x20: ffff0000d75816c0 x19: ffff0000dd52a000 x18: 00000000ffffffff x17: ffff800092f39000 x16: ffff80008adbe9e4 x15: 0000000000000005 x14: 1ffff000139faf1c x13: 0000000000000000 x12: 0000000000000000 x11: ffff7000139faf21 x10: 0000000000000003 x9 : ffff80008f27b938 x8 : 0000000000000002 x7 : 0000000000000000 x6 : 0000000000000000 x5 : 00000000ffffffff x4 : 0000000000400dc0 x3 : 0000000200000000 x2 : 000000010cd004a8 x1 : ffff80008b3ebc40 x0 : 0000000000000001 Call trace: __kvmalloc_node_noprof+0x520/0x640 mm/slub.c:5024 (P) kvmalloc_array_node_noprof include/linux/slab.h:1065 [inline] io_rsrc_data_alloc io_uring/rsrc.c:206 [inline] io_clone_buffers io_uring/rsrc.c:1178 [inline] io_register_clone_buffers+0x484/0xa14 io_uring/rsrc.c:1287 __io_uring_register io_uring/register.c:815 [inline] __do_sys_io_uring_register io_uring/register.c:926 [inline] __se_sys_io_uring_register io_uring/register.c:903 [inline] __arm64_sys_io_uring_register+0x42c/0xea8 io_uring/register.c:903 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x58/0x17c arch/arm64/kernel/entry-common.c:767 el0t_64_sync_handler+0x78/0x108 arch/arm64/kernel/entry-common.c:786 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 which is due to offset + buffer_count being too large. The registration code checks only the total count of buffers, but given that the indexing is an array, it should also check offset + count. That can't exceed IORING_MAX_REG_BUFFERS either, as there's no way to reach buffers beyond that limit. There's no issue with registrering a table this large, outside of the fact that it's pointless to register buffers that cannot be reached, and that it can trigger this kmalloc() warning for attempting an allocation that is too large. The Linux kernel CVE team has assigned CVE-2025-38196 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit b16e920a1909da6799c43000db730d8fcdcae907 and fixed in 6.15.4 with commit 0e23ac818f3afb16660b0ba384875d56a7013879 Issue introduced in 6.13 with commit b16e920a1909da6799c43000db730d8fcdcae907 and fixed in 6.16-rc3 with commit 1d27f11bf02b38c431e49a17dee5c10a2b4c2e28 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-38196 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/0e23ac818f3afb16660b0ba384875d56a7013879 https://git.kernel.org/stable/c/1d27f11bf02b38c431e49a17dee5c10a2b4c2e28