CVE-2025-68787: netrom: Fix memory leak in nr_sendmsg()
In the Linux kernel, the following vulnerability has been resolved:
netrom: Fix memory leak in nrsendmsg()
syzbot reported a memory leak [1].
When function sockallocsendskb() return NULL in nroutput(), the original skb is not freed, which was allocated in nrsendmsg(). Fix this by freeing it before return.
[1] BUG: memory leak unreferenced object 0xffff888129f35500 (size 240): comm "syz.0.17", pid 6119, jiffies 4294944652 hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 10 52 28 81 88 ff ff ..........R(.... backtrace (crc 1456a3e4): kmemleakallocrecursive include/linux/kmemleak.h:44 [inline] slabpostallochook mm/slub.c:4983 [inline] slaballocnode mm/slub.c:5288 [inline] kmemcacheallocnodenoprof+0x36f/0x5e0 mm/slub.c:5340 allocskb+0x203/0x240 net/core/skbuff.c:660 allocskb include/linux/skbuff.h:1383 [inline] allocskbwithfrags+0x69/0x3f0 net/core/skbuff.c:6671 sockallocsendpskb+0x379/0x3e0 net/core/sock.c:2965 sockallocsendskb include/net/sock.h:1859 [inline] nrsendmsg+0x287/0x450 net/netrom/afnetrom.c:1105 socksendmsgnosec net/socket.c:727 [inline] socksendmsg net/socket.c:742 [inline] sockwriteiter+0x293/0x2a0 net/socket.c:1195 newsyncwrite fs/readwrite.c:593 [inline] vfswrite+0x45d/0x710 fs/readwrite.c:686 ksyswrite+0x143/0x170 fs/readwrite.c:738 dosyscallx64 arch/x86/entry/syscall64.c:63 [inline] dosyscall64+0xa4/0xfa0 arch/x86/entry/syscall64.c:94 entrySYSCALL64afterhwframe+0x77/0x7f
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.113-1Fixed in 7.2.12-1Fixed in 7.2.13-1 - Compensating control
In the Linux kernel netrom implementation, free the original skb allocated in nr_sendmsg() before returning from nr_output() when sock_alloc_send_skb() returns NULL.
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68787?
CVE-2025-68787 is classified as a medium severity vulnerability due to the potential for a memory leak in the Linux kernel.
How do I fix CVE-2025-68787?
To fix CVE-2025-68787, update your Linux kernel to a version that includes the patch addressing the memory leak.
What software is affected by CVE-2025-68787?
CVE-2025-68787 affects the Linux kernel, specifically versions prior to the patch that resolves the memory leak.
What type of vulnerability is CVE-2025-68787?
CVE-2025-68787 is a memory leak vulnerability that occurs in the function nr_sendmsg() within the Linux kernel.
Who reported CVE-2025-68787?
CVE-2025-68787 was reported by the syzbot, which is a tool for finding bugs in the Linux kernel.