CVE-2024-26731
bpf, sockmap: Fix NULL pointer dereference in sk_psock_verdict_data_ready()
Check your servers for CVE-2024-26731
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-26731 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In the Linux kernel, the following vulnerability has been resolved:
bpf, sockmap: Fix NULL pointer dereference in sk_psock_verdict_data_ready()
syzbot reported the following NULL pointer dereference issue [1]:
BUG: kernel NULL pointer dereference, address: 0000000000000000 [...] RIP: 0010:0x0 [...] Call Trace: <TASK> sk_psock_verdict_data_ready+0x232/0x340 net/core/skmsg.c:1230 unix_stream_sendmsg+0x9b4/0x1230 net/unix/af_unix.c:2293 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg+0x221/0x270 net/socket.c:745 ____sys_sendmsg+0x525/0x7d0 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_64+0xf9/0x240 entry_SYSCALL_64_after_hwframe+0x6f/0x77
If sk_psock_verdict_data_ready() and sk_psock_stop_verdict() are called concurrently, psock->saved_data_ready can be NULL, causing the above issue.
This patch fixes this issue by calling the appropriate data ready function using the sk_psock_data_ready() helper and protecting it from concurrency with sk->sk_callback_lock.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality none, integrity none, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.83%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 58.8% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 3 Apr 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-476 NULL Pointer Dereference
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from dd628fc697ee59b76bd3877c4bd13f07ccc3776f, before 4588b13abcbd561ec67f5b3c1cb2eff690990a54 affected from 6df7f764cd3cf5a03a4a47b23be47e57e41fcd85, before 9b099ed46dcaf1403c531ff02c3d7400fa37fa26 affected from 6df7f764cd3cf5a03a4a47b23be47e57e41fcd85, before d61608a4e394f23e0dca099df9eb8e555453d949 affected from 6df7f764cd3cf5a03a4a47b23be47e57e41fcd85, before 4cd12c6065dfcdeba10f49949bffcf383b3952d8 affected d3cbd7c571446a876aefd8320500300b2c951c58 affected from 6.1.32, before 6.1.80 affected from 6.3.6, before 6.4
Other versions: unaffected
|
| Linux |
affected 6.4 unaffected before 6.4 unaffected from 6.1.80 up to and including 6.1.* unaffected from 6.6.19 up to and including 6.6.* unaffected from 6.7.7 up to and including 6.7.* unaffected 6.8 and later
Other versions: affected
|
Is my server affected?
This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:
uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2024-26731 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2024-26731
With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-26731
trivy image --scanners vuln IMAGE | grep CVE-2024-26731
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Other references
- https://git.kernel.org/stable/c/4588b13abcbd561ec67f5b3c1cb2eff690990a54 git.kernel.org
- https://git.kernel.org/stable/c/9b099ed46dcaf1403c531ff02c3d7400fa37fa26 git.kernel.org
- https://git.kernel.org/stable/c/d61608a4e394f23e0dca099df9eb8e555453d949 git.kernel.org
- https://git.kernel.org/stable/c/4cd12c6065dfcdeba10f49949bffcf383b3952d8 git.kernel.org
Source: the record CVE-2024-26731 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse