CVE-2023-52828
bpf: Detect IP == ksym.end as part of BPF program
Check your servers for CVE-2023-52828
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-2023-52828 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: Detect IP == ksym.end as part of BPF program
Now that bpf_throw kfunc is the first such call instruction that has noreturn semantics within the verifier, this also kicks in dead code elimination in unprecedented ways. For one, any instruction following a bpf_throw call will never be marked as seen. Moreover, if a callchain ends up throwing, any instructions after the call instruction to the eventually throwing subprog in callers will also never be marked as seen.
The tempting way to fix this would be to emit extra 'int3' instructions which bump the jited_len of a program, and ensure that during runtime when a program throws, we can discover its boundaries even if the call instruction to bpf_throw (or to subprogs that always throw) is emitted as the final instruction in the program.
An example of such a program would be this:
do_something(): ... r0 = 0 exit
foo(): r1 = 0 call bpf_throw r0 = 0 exit
bar(cond): if r1 != 0 goto pc+2 call do_something exit call foo r0 = 0 // Never seen by verifier exit //
main(ctx): r1 = ... call bar r0 = 0 exit
Here, if we do end up throwing, the stacktrace would be the following:
bpf_throw foo bar main
In bar, the final instruction emitted will be the call to foo, as such, the return address will be the subsequent instruction (which the JIT emits as int3 on x86). This will end up lying outside the jited_len of the program, thus, when unwinding, we will fail to discover the return address as belonging to any program and end up in a panic due to the unreliable stack unwinding of BPF programs that we never expect.
To remedy this case, make bpf_prog_ksym_find treat IP == ksym.end as part of the BPF program, so that is_bpf_text_address returns true when such a case occurs, and we are able to unwind reliably when the final instruction ends up being a call instruction.
Severity (CVSS)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
- Attack vector
- local: the attacker needs local access, or a user has to open a prepared file
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity low, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 0.25%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 16.9% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 29 May 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
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Linux |
affected from 74451e66d516c55e309e8d89a4a1e7596e46aacd, before 6058e4829696412457729a00734969acc6fd1d18 affected from 74451e66d516c55e309e8d89a4a1e7596e46aacd, before cf353904a82873e952633fcac4385c2fcd3a46e1 affected from 74451e66d516c55e309e8d89a4a1e7596e46aacd, before aa42a7cb92647786719fe9608685da345883878f affected from 74451e66d516c55e309e8d89a4a1e7596e46aacd, before 327b92e8cb527ae097961ffd1610c720481947f5 affected from 74451e66d516c55e309e8d89a4a1e7596e46aacd, before 821a7e4143af115b840ec199eb179537e18af922 affected from 74451e66d516c55e309e8d89a4a1e7596e46aacd, before 66d9111f3517f85ef2af0337ece02683ce0faf21
Other versions: unaffected
|
| Linux |
affected 4.11 unaffected before 4.11 unaffected from 5.10.202 up to and including 5.10.* unaffected from 5.15.140 up to and including 5.15.* unaffected from 6.1.64 up to and including 6.1.* unaffected from 6.5.13 up to and including 6.5.* unaffected from 6.6.3 up to and including 6.6.* unaffected 6.7 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-2023-52828 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2023-52828
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-2023-52828
trivy image --scanners vuln IMAGE | grep CVE-2023-52828
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/6058e4829696412457729a00734969acc6fd1d18 git.kernel.org
- https://git.kernel.org/stable/c/cf353904a82873e952633fcac4385c2fcd3a46e1 git.kernel.org
- https://git.kernel.org/stable/c/aa42a7cb92647786719fe9608685da345883878f git.kernel.org
- https://git.kernel.org/stable/c/327b92e8cb527ae097961ffd1610c720481947f5 git.kernel.org
- https://git.kernel.org/stable/c/821a7e4143af115b840ec199eb179537e18af922 git.kernel.org
- https://git.kernel.org/stable/c/66d9111f3517f85ef2af0337ece02683ce0faf21 git.kernel.org
Source: the record CVE-2023-52828 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse