CVE-2024-41006
kernel: netrom: Fix a memory leak in nr_heartbeat_expiry()
Overview
Description
In the Linux kernel, the following vulnerability has been resolved:
netrom: Fix a memory leak in nr_heartbeat_expiry()
syzbot reported a memory leak in nr_create() [0].
Commit 409db27e3a2e ("netrom: Fix use-after-free of a listening socket.")
added sock_hold() to the nr_heartbeat_expiry() function, where
a) a socket has a SOCK_DESTROY flag or
b) a listening socket has a SOCK_DEAD flag.
But in the case "a," when the SOCK_DESTROY flag is set, the file descriptor
has already been closed and the nr_release() function has been called.
So it makes no sense to hold the reference count because no one will
call another nr_destroy_socket() and put it as in the case "b."
nr_connect
nr_establish_data_link
nr_start_heartbeat
nr_release
switch (nr->state)
case NR_STATE_3
nr->state = NR_STATE_2
sock_set_flag(sk, SOCK_DESTROY);
nr_rx_frame
nr_process_rx_frame
switch (nr->state)
case NR_STATE_2
nr_state2_machine()
nr_disconnect()
nr_sk(sk)->state = NR_STATE_0
sock_set_flag(sk, SOCK_DEAD)
nr_heartbeat_expiry
switch (nr->state)
case NR_STATE_0
if (sock_flag(sk, SOCK_DESTROY) ||
(sk->sk_state == TCP_LISTEN
&& sock_flag(sk, SOCK_DEAD)))
sock_hold() // ( !!! )
nr_destroy_socket()
To fix the memory leak, let's call sock_hold() 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
Source: OX vulnerability database
Severity
5.5 · MEDIUM
CVSS 3.1 base score, scored by NVD.
- Attack vector
- Local
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness: CWE-401
Affected packages · 0
No registry package. This ID affects operating system packages only.
Operating systems · 129 fixes
Azure Linux 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 3.0 | kernel | 0:6.6.47.1-1.azl3 |
Oracle Linux 3 releases · 4 packages
| Release | Package | Fixed in |
|---|---|---|
| 7 | kernel-uek-headers +1 | 4.14.35-2047.541.4.1.el7uek |
| 7 | kernel-uek-container +1 | 5.4.17-2136.335.4.el7 |
| 7 | kernel-uek +8 | 5.4.17-2136.335.4.el7uek |
| 8 | bpftool +13 | 5.15.0-210.163.7.el8uek |
| 9 | bpftool +13 | 5.15.0-210.163.7.el9uek |
Photon OS 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 5.0 | bpftool +10 | 6.1.97-1.ph5 |
SUSE Linux Enterprise 2 releases · 9 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 15.5 | kernel-livepatch-5-14-21-150500-13-64-rt | 1-150500.11.3.1 | SUSE-SU-2024:2894-1 |
| 15.5 | kernel-livepatch-5-14-21-150500-55-73-default | 1-150500.11.3.1 | SUSE-SU-2024:2939-1 |
| 15.5 | kernel-azure +4 | 5.14.21-150500.33.63.1 | SUSE-SU-2024:2947-1 |
| 15.5 | cluster-md-kmp-default +17 | 5.14.21-150500.55.73.1 | SUSE-SU-2024:2939-1 |
| 15.5 | kernel-default-base | 5.14.21-150500.55.73.1.150500.6.33.8 | SUSE-SU-2024:2939-1 |
| 15.5 | kernel-docs | 5.14.21-150500.55.73.2 | SUSE-SU-2024:2939-1 |
7 more rows
SUSE Linux Enterprise Micro 2 releases · 4 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.5 | kernel-rt +1 | 5.14.21-150500.13.64.1 | SUSE-SU-2024:2894-1 |
| 5.5 | kernel-default | 5.14.21-150500.55.73.1 | SUSE-SU-2024:2939-1 |
| 5.5 | kernel-default-base | 5.14.21-150500.55.73.1.150500.6.33.8 | SUSE-SU-2024:2939-1 |
| 6.0 | kernel-default-base | 6.4.0-17.1.1.51 | SUSE-SU-2025:20008-1 |
| 6.0 | kernel-default +5 | 6.4.0-18.1 | SUSE-SU-2025:20008-1 |
| 6.0 | kernel-devel-rt +2 | 6.4.0-9.1 | SUSE-SU-2025:20028-1 |
debian 4 releases · 2 packages
| Release | Package | Fixed in |
|---|---|---|
| 11 | linux | 5.10.221-1 |
| 11 | linux-6-1 | 6.1.119-1~deb11u1 |
| 12 | linux | 6.1.99-1 |
| 13 | linux | 6.9.7-1 |
| 14 | linux | 6.9.7-1 |
echo 1 release · 1 package
| Release | Package | Fixed in |
|---|---|---|
| linux | 6.9.7-1 |
openSUSE Leap Micro 1 release · 3 packages
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| 5.5 | kernel-rt | 5.14.21-150500.13.64.1 | SUSE-SU-2024:2894-1 |
| 5.5 | kernel-default | 5.14.21-150500.55.73.1 | SUSE-SU-2024:2939-1 |
| 5.5 | kernel-default-base | 5.14.21-150500.55.73.1.150500.6.33.8 | SUSE-SU-2024:2939-1 |
root.io debian 3 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 11 | rootio-linux | 5.10.221-1 |
| 12 | rootio-linux | 6.1.99-1 |
| 13 | rootio-linux | 6.9.7-1 |
root.io ubuntu 2 releases · 1 package
| Release | Package | Fixed in |
|---|---|---|
| 22.04 | rootio-linux | 5.15.0-121.131 |
| 24.04 | rootio-linux | 6.8.0-44.44 |
ubuntu 5 releases · 47 packages
| Release | Package | Fixed in |
|---|---|---|
| 18.04-ESM | linux-oracle | 4.15.0-1148.159 |
| 18.04-ESM | linux-kvm | 4.15.0-1168.173 |
| 18.04-ESM | linux-gcp-4-15 | 4.15.0-1179.196 |
| 18.04-ESM | linux-aws | 4.15.0-1186.199 |
| 18.04-ESM | linux-azure-4-15 | 4.15.0-1194.209 |
| 18.04-ESM | linux | 4.15.0-243.255 |
83 more rows
References
- access.redhat.com https://access.redhat.com/security/cve/CVE-2024-41006
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-265688.html
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-355557.html
- cert-portal.siemens.com https://cert-portal.siemens.com/productcert/html/ssa-613116.html
- git.kernel.org https://git.kernel.org/linus/0b9130247f3b6a1122478471ff0e014ea96bb735 (6.10-rc5)
- git.kernel.org https://git.kernel.org/stable/c/0b9130247f3b6a1122478471ff0e014ea96bb735
- git.kernel.org https://git.kernel.org/stable/c/280cf1173726a7059b628c610c71050d5c0b6937
- git.kernel.org https://git.kernel.org/stable/c/5391f9db2cab5ef1cb411be1ab7dbec728078fba
- git.kernel.org https://git.kernel.org/stable/c/a02fd5d775cf9787ee7698c797e20f2fa13d2e2b
- git.kernel.org https://git.kernel.org/stable/c/b6ebe4fed73eedeb73f4540f8edc4871945474c8
Show all 43 references
- git.kernel.org https://git.kernel.org/stable/c/d377f5a28332954b19e373d36823e59830ab1712
- git.kernel.org https://git.kernel.org/stable/c/d616876256b38ecf9a1a1c7d674192c5346bc69c
- git.kernel.org https://git.kernel.org/stable/c/e07a9c2a850cdebf625e7a1b8171bd23a8554313
- linux.oracle.com https://linux.oracle.com/cve/CVE-2024-41006.html
- linux.oracle.com https://linux.oracle.com/errata/ELSA-2024-12779.html
- lists.debian.org https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html
- lore.kernel.org https://lore.kernel.org/linux-cve-announce/2024071244-CVE-2024-41006-d24b@gregkh/T
- nvd.nist.gov https://nvd.nist.gov/vuln/detail/CVE-2024-41006
- ubuntu.com https://ubuntu.com/security/notices/USN-6999-1
- ubuntu.com https://ubuntu.com/security/notices/USN-6999-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7003-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7003-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7003-3
- ubuntu.com https://ubuntu.com/security/notices/USN-7003-4
- ubuntu.com https://ubuntu.com/security/notices/USN-7003-5
- ubuntu.com https://ubuntu.com/security/notices/USN-7004-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7005-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7005-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7006-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7007-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7007-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7007-3
- ubuntu.com https://ubuntu.com/security/notices/USN-7008-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7009-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7009-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7019-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7029-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7853-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7853-2
- ubuntu.com https://ubuntu.com/security/notices/USN-7853-3
- ubuntu.com https://ubuntu.com/security/notices/USN-7854-1
- ubuntu.com https://ubuntu.com/security/notices/USN-7937-1
- www.cve.org https://www.cve.org/CVERecord?id=CVE-2024-41006
OX Radar and Response Center
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.