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 E79D11DF980 for ; Mon, 8 Dec 2025 01:19:58 +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=1765156799; cv=none; b=nuz5kJixZPDCyX8J86pU65kmXL39ckYAJzQdrToAhyV8odXQsOJMrNtaYZrCE4lP+P6YgPCc29fNiEA2ltaxDcvNLmS+C/a5UQpHRDynIjTz7+WJkRNVnknbkV80j/4Gfedu9gBvutfpAVyx8lBrzo/Ve7y3aWKOOuVlI4EnQT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765156799; c=relaxed/simple; bh=ytz64izZjFtwh7oHrAUvGb1/IkIxkhAzCLtdvhLPxIw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=RmjvzPME5dpwoEajwlIHY+6Ai0AgObjNz1GTFdLt1XWLVu/+LlPZ91sMQQlgLp0P322jTHIMa/yrBawuPEuXfg1R5SU8HWEfhh9GoLVgWgdsjqj5WbXuMBcTQmGcJiKD2ZAhFAvTlM6yZaCGUuuo1Vsjtwa2/jjTVYQrXMwSEdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uuM6pexf; 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="uuM6pexf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D305C4CEFB; Mon, 8 Dec 2025 01:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765156798; bh=ytz64izZjFtwh7oHrAUvGb1/IkIxkhAzCLtdvhLPxIw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=uuM6pexfQQKYob0WFNTKgSGOvm3SRl1Kvrm6Hf2rZ6Z7hVe9hvmOf7Eqdcs/kCHfd T7CALwGjvNi0rXrMzrk3wqXiW2IO/d8tafXXCm5dX8uC6BIdp9CmXx2LTbVpR3PpO8 u+XywKRPT70ksw6TTA047hFr2yx7vWcFbvdFU7xQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53752: net: deal with integer overflows in kmalloc_reserve() Date: Mon, 8 Dec 2025 10:19:51 +0900 Message-ID: <2025120843-CVE-2023-53752-339f@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4921; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=TOMf+DjO0vrqAV/lxYk5eqlp6RoHB3bB+kNqR2IGjD0=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlm6uvf1uT9sK+vuNOTc3DOteyrDMXzjz9bcVN/G797h LO2xDmJjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZiIZjzDgs7tjy9yLne15LXq nVrca1J89OP95wzzc5//PfNkpphPTd2ceI6tG6yPm8ivAgA= 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: net: deal with integer overflows in kmalloc_reserve() Blamed commit changed: ptr = kmalloc(size); if (ptr) size = ksize(ptr); size = kmalloc_size_roundup(size); ptr = kmalloc(size); This allowed various crash as reported by syzbot [1] and Kyle Zeng. Problem is that if @size is bigger than 0x80000001, kmalloc_size_roundup(size) returns 2^32. kmalloc_reserve() uses a 32bit variable (obj_size), so 2^32 is truncated to 0. kmalloc(0) returns ZERO_SIZE_PTR which is not handled by skb allocations. Following trace can be triggered if a netdev->mtu is set close to 0x7fffffff We might in the future limit netdev->mtu to more sensible limit (like KMALLOC_MAX_SIZE). This patch is based on a syzbot report, and also a report and tentative fix from Kyle Zeng. [1] BUG: KASAN: user-memory-access in __build_skb_around net/core/skbuff.c:294 [inline] BUG: KASAN: user-memory-access in __alloc_skb+0x3c4/0x6e8 net/core/skbuff.c:527 Write of size 32 at addr 00000000fffffd10 by task syz-executor.4/22554 CPU: 1 PID: 22554 Comm: syz-executor.4 Not tainted 6.1.39-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:279 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:286 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x120/0x1a0 lib/dump_stack.c:106 print_report+0xe4/0x4b4 mm/kasan/report.c:398 kasan_report+0x150/0x1ac mm/kasan/report.c:495 kasan_check_range+0x264/0x2a4 mm/kasan/generic.c:189 memset+0x40/0x70 mm/kasan/shadow.c:44 __build_skb_around net/core/skbuff.c:294 [inline] __alloc_skb+0x3c4/0x6e8 net/core/skbuff.c:527 alloc_skb include/linux/skbuff.h:1316 [inline] igmpv3_newpack+0x104/0x1088 net/ipv4/igmp.c:359 add_grec+0x81c/0x1124 net/ipv4/igmp.c:534 igmpv3_send_cr net/ipv4/igmp.c:667 [inline] igmp_ifc_timer_expire+0x1b0/0x1008 net/ipv4/igmp.c:810 call_timer_fn+0x1c0/0x9f0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x54c/0x710 kernel/time/timer.c:1790 run_timer_softirq+0x28/0x4c kernel/time/timer.c:1803 _stext+0x380/0xfbc ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:891 do_softirq_own_stack+0x20/0x2c arch/arm64/kernel/irq.c:84 invoke_softirq kernel/softirq.c:437 [inline] __irq_exit_rcu+0x1c0/0x4cc kernel/softirq.c:683 irq_exit_rcu+0x14/0x78 kernel/softirq.c:695 el0_interrupt+0x7c/0x2e0 arch/arm64/kernel/entry-common.c:717 __el0_irq_handler_common+0x18/0x24 arch/arm64/kernel/entry-common.c:724 el0t_64_irq_handler+0x10/0x1c arch/arm64/kernel/entry-common.c:729 el0t_64_irq+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The Linux kernel CVE team has assigned CVE-2023-53752 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1.31 with commit 0dbc898f5917c5a3bec6be19d9f5469cbc351a7d and fixed in 6.1.54 with commit 31cf7853a940181593e4472fc56f46574123f9f6 Issue introduced in 6.2 with commit 12d6c1d3a2ad0c199ec57c201cdc71e8e157a232 and fixed in 6.4.16 with commit e4ffc47a1c3e5d11a853aa178c9a5136e79412e9 Issue introduced in 6.2 with commit 12d6c1d3a2ad0c199ec57c201cdc71e8e157a232 and fixed in 6.5.3 with commit bf7da02d2b8faf324206e1cbe64a4813ff903cc1 Issue introduced in 6.2 with commit 12d6c1d3a2ad0c199ec57c201cdc71e8e157a232 and fixed in 6.6 with commit 915d975b2ffa58a14bfcf16fafe00c41315949ff 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-2023-53752 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: net/core/skbuff.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/31cf7853a940181593e4472fc56f46574123f9f6 https://git.kernel.org/stable/c/e4ffc47a1c3e5d11a853aa178c9a5136e79412e9 https://git.kernel.org/stable/c/bf7da02d2b8faf324206e1cbe64a4813ff903cc1 https://git.kernel.org/stable/c/915d975b2ffa58a14bfcf16fafe00c41315949ff