CVE-2023-53752

Source
https://cve.org/CVERecord?id=CVE-2023-53752
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53752.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-53752
Downstream
Related
Published
2025-12-08T01:19:12.407Z
Modified
2026-03-23T05:04:10.872907102Z
Summary
net: deal with integer overflows in kmalloc_reserve()
Details

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, kmallocsizeroundup(size) returns 2^32.

kmallocreserve() uses a 32bit variable (objsize), so 2^32 is truncated to 0.

kmalloc(0) returns ZEROSIZEPTR 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 KMALLOCMAXSIZE).

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 __buildskbaround net/core/skbuff.c:294 [inline] BUG: KASAN: user-memory-access in _allocskb+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: dumpbacktrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:279 showstack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:286 __dumpstack lib/dumpstack.c:88 [inline] dump_stacklvl+0x120/0x1a0 lib/dumpstack.c:106 printreport+0xe4/0x4b4 mm/kasan/report.c:398 kasanreport+0x150/0x1ac mm/kasan/report.c:495 kasancheckrange+0x264/0x2a4 mm/kasan/generic.c:189 memset+0x40/0x70 mm/kasan/shadow.c:44 __buildskbaround net/core/skbuff.c:294 [inline] __allocskb+0x3c4/0x6e8 net/core/skbuff.c:527 allocskb include/linux/skbuff.h:1316 [inline] igmpv3newpack+0x104/0x1088 net/ipv4/igmp.c:359 addgrec+0x81c/0x1124 net/ipv4/igmp.c:534 igmpv3sendcr net/ipv4/igmp.c:667 [inline] igmpifctimerexpire+0x1b0/0x1008 net/ipv4/igmp.c:810 calltimerfn+0x1c0/0x9f0 kernel/time/timer.c:1474 expiretimers kernel/time/timer.c:1519 [inline] __runtimers+0x54c/0x710 kernel/time/timer.c:1790 runtimer_softirq+0x28/0x4c kernel/time/timer.c:1803 _stext+0x380/0xfbc ____dosoftirq+0x14/0x20 arch/arm64/kernel/irq.c:79 callonirqstack+0x24/0x4c arch/arm64/kernel/entry.S:891 dosoftirqownstack+0x20/0x2c arch/arm64/kernel/irq.c:84 invokesoftirq kernel/softirq.c:437 [inline] __irqexitrcu+0x1c0/0x4cc kernel/softirq.c:683 irq_exitrcu+0x14/0x78 kernel/softirq.c:695 el0interrupt+0x7c/0x2e0 arch/arm64/kernel/entry-common.c:717 __el0irqhandlercommon+0x18/0x24 arch/arm64/kernel/entry-common.c:724 el0t64irqhandler+0x10/0x1c arch/arm64/kernel/entry-common.c:729 el0t64irq+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53752.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0dbc898f5917c5a3bec6be19d9f5469cbc351a7d
Fixed
31cf7853a940181593e4472fc56f46574123f9f6
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
12d6c1d3a2ad0c199ec57c201cdc71e8e157a232
Fixed
e4ffc47a1c3e5d11a853aa178c9a5136e79412e9
Fixed
bf7da02d2b8faf324206e1cbe64a4813ff903cc1
Fixed
915d975b2ffa58a14bfcf16fafe00c41315949ff

Affected versions

v6.*
v6.1
v6.1-rc3
v6.1-rc4
v6.1-rc5
v6.1-rc6
v6.1-rc7
v6.1-rc8
v6.1.31
v6.1.32
v6.1.33
v6.1.34
v6.1.35
v6.1.36
v6.1.37
v6.1.38
v6.1.39
v6.1.40
v6.1.41
v6.1.42
v6.1.43
v6.1.44
v6.1.45
v6.1.46
v6.1.47
v6.1.48
v6.1.49
v6.1.50
v6.1.51
v6.1.52
v6.1.53
v6.2
v6.2-rc1
v6.2-rc2
v6.2-rc3
v6.2-rc4
v6.2-rc5
v6.2-rc6
v6.2-rc7
v6.2-rc8
v6.3
v6.3-rc1
v6.3-rc2
v6.3-rc3
v6.3-rc4
v6.3-rc5
v6.3-rc6
v6.3-rc7
v6.4
v6.4-rc1
v6.4-rc2
v6.4-rc3
v6.4-rc4
v6.4-rc5
v6.4-rc6
v6.4-rc7
v6.4.1
v6.4.10
v6.4.11
v6.4.12
v6.4.13
v6.4.14
v6.4.15
v6.4.2
v6.4.3
v6.4.4
v6.4.5
v6.4.6
v6.4.7
v6.4.8
v6.4.9
v6.5
v6.5-rc1
v6.5-rc2
v6.5-rc3
v6.5-rc4
v6.5-rc5
v6.5-rc6
v6.5-rc7
v6.5.1
v6.5.2

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53752.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.1.54
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.4.16
Fixed
6.5.3

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53752.json"