CVE-2023-52828·Kernel vulnerability
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
- medium
- Software
- Kernel
- Fixed in
- 6.6.3
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at <0.1% — higher than 4% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Affected versions
From: 6.6
Until: 6.6.3
Fixed in: 6.6.3
How to fix this CVE
Update your Linux kernel to version 6.6.3 or later to resolve this BPF stack unwinding vulnerability. This fix addresses an issue where eBPF programs ending with noreturn function calls could cause kernel panics during stack trace generation. Apply the kernel update through your distribution's package manager and reboot your system to apply the changes.
sudo dnf update kernel kernel-develDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check kernel version with `uname -r` and compare against 6.6.3 — any version 6.6.0 through 6.6.2 is vulnerable
- Step 2: Verify eBPF support is enabled: `grep -i bpf /boot/config-$(uname -r)` should show CONFIG_BPF=y and CONFIG_BPF_SYSCALL=y
- Step 3: Search kernel logs for BPF-related panics: `dmesg | grep -i 'bpf\|stack'` or check `/var/log/kern.log` for unreliable unwinding messages
- Step 4: After applying patches, confirm the new kernel version with `uname -r` and verify it shows 6.6.3 or higher
FAQ
What is CVE-2023-52828?
This vulnerability affects the Linux kernel's eBPF verifier, specifically when programs use the noreturn bpf_throw kfunc. The issue causes stack unwinding to fail when a BPF program's final instruction is a call to a function that throws, because the return address lands outside the program's jitted code boundary, leading to kernel panics.
Is CVE-2023-52828 being actively exploited?
No, CVE-2023-52828 is not listed in the CISA KEV catalog and has no known public exploits. However, the vulnerability can be triggered by malicious or misconfigured eBPF programs loaded on the system.
What versions of Kernel are affected by CVE-2023-52828?
Linux kernel versions 6.6 through 6.6.2 are affected. The fix was released in kernel 6.6.3 and backported to stable branches.
How do I check if my server is vulnerable to CVE-2023-52828?
Run `uname -r` to check your kernel version. If it reports 6.6.0, 6.6.1, or 6.6.2, your system is vulnerable. Systems on other kernel series (5.15, 6.1, 6.5, etc.) are not affected.
Does Defensia detect CVE-2023-52828?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel package is installed on a monitored server running vulnerable versions, CVE-2023-52828 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/327b92e8cb527ae097961ffd1610c720481947f5
- https://git.kernel.org/stable/c/6058e4829696412457729a00734969acc6fd1d18
- https://git.kernel.org/stable/c/66d9111f3517f85ef2af0337ece02683ce0faf21
- https://git.kernel.org/stable/c/821a7e4143af115b840ec199eb179537e18af922
- https://git.kernel.org/stable/c/aa42a7cb92647786719fe9608685da345883878f
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2023-52828. Free for 1 server.
Get started free