CVE-2024-41006: netrom: Fix a memory leak in nr_heartbeat_expiry()

Published Jul 12, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

netrom: Fix a memory leak in nrheartbeatexpiry()

syzbot reported a memory leak in nrcreate() [0].

Commit 409db27e3a2e ("netrom: Fix use-after-free of a listening socket.") added sockhold() to the nrheartbeatexpiry() function, where a) a socket has a SOCKDESTROY flag or b) a listening socket has a SOCKDEAD flag.

But in the case "a," when the SOCKDESTROY flag is set, the file descriptor has already been closed and the nrrelease() function has been called. So it makes no sense to hold the reference count because no one will call another nrdestroysocket() and put it as in the case "b."

nrconnect nrestablishdatalink nrstartheartbeat

nrrelease switch (nr->state) case NRSTATE3 nr->state = NRSTATE2 socksetflag(sk, SOCKDESTROY);

nrrxframe nrprocessrxframe switch (nr->state) case NRSTATE2 nrstate2machine() nrdisconnect() nrsk(sk)->state = NRSTATE0 socksetflag(sk, SOCKDEAD)

nrheartbeatexpiry switch (nr->state) case NRSTATE0 if (sockflag(sk, SOCKDESTROY) || (sk->skstate == TCPLISTEN && sockflag(sk, SOCKDEAD))) sockhold() // ( !!! ) nrdestroysocket()

To fix the memory leak, let's call sockhold() only for a listening socket.

Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with Syzkaller.

[0]: https://syzkaller.appspot.com/bug?extid=d327a1f3b12e1e206c16

Affected Software

15 affected componentsFixes available
Linux Linux kernel>=4.19.272<4.19.317
Linux Linux kernel>=5.4.231<5.4.279
Linux Linux kernel>=5.10.166<5.10.221
Linux Linux kernel>=5.15.91<5.15.162
Linux Linux kernel>=6.1.9<6.1.96
Linux Linux kernel>=6.2<6.6.36
Linux Linux kernel>=6.7<6.9.7
Linux Linux kernel=6.10-rc1
Linux Linux kernel=6.10-rc2
Linux Linux kernel=6.10-rc3
Linux Linux kernel=6.10-rc4
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1
debian/linux-6.1
6.1.129-1~deb11u1
Microsoft azl3 kernel 6.6.35.1-5
Microsoft azl3 kernel 6.6.47.1-1

Event History

Jul 12, 2024
CVE Published
via MITRE·12:44 PM
Data Sourced
via MITRE·12:44 PM
Description
Data Sourced
via NVD·01:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Sep 11, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
May 5, 2025
Data Sourced
via Ubuntu·06:18 PM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-41006?

The severity of CVE-2024-41006 is not explicitly rated, but it involves a memory leak in the Linux kernel that may lead to performance issues.

2

How do I fix CVE-2024-41006?

To fix CVE-2024-41006, update your Linux kernel to the latest fixed versions, such as 5.10.223-1 or 6.1.123-1.

3

Which versions of the Linux kernel are affected by CVE-2024-41006?

CVE-2024-41006 affects multiple versions, including certain versions between 4.19.272 to 4.19.317, 5.4.231 to 5.4.279, and others up to 6.10-rc4.

4

What type of vulnerability is CVE-2024-41006?

CVE-2024-41006 is a memory leak vulnerability affecting the netrom subsystem in the Linux kernel.

5

Who reported the CVE-2024-41006 vulnerability?

The CVE-2024-41006 vulnerability was reported by syzbot, a tool for testing the Linux kernel.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203