CVE-2023-52828
published 2024-05-21CVE-2023-52828: 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…
PriorityP419medium5.5CVSS 3.1
AVLACLPRLUINSUCNINAH
EPSS
0.25%
15.9th percentile
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.
Affected
17 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | linux | < linux 6.1.64-1 (bookworm) | linux 6.1.64-1 (bookworm) |
| linux | linux | — | — |
| linux | linux | >= 74451e66d516c55e309e8d89a4a1e7596e46aacd < 6058e4829696412457729a00734969acc6fd1d18 | 6058e4829696412457729a00734969acc6fd1d18 |
| linux | linux | >= 74451e66d516c55e309e8d89a4a1e7596e46aacd < cf353904a82873e952633fcac4385c2fcd3a46e1 | cf353904a82873e952633fcac4385c2fcd3a46e1 |
| linux | linux | >= 74451e66d516c55e309e8d89a4a1e7596e46aacd < aa42a7cb92647786719fe9608685da345883878f | aa42a7cb92647786719fe9608685da345883878f |
| linux | linux | >= 74451e66d516c55e309e8d89a4a1e7596e46aacd < 327b92e8cb527ae097961ffd1610c720481947f5 | 327b92e8cb527ae097961ffd1610c720481947f5 |
| linux | linux | >= 74451e66d516c55e309e8d89a4a1e7596e46aacd < 821a7e4143af115b840ec199eb179537e18af922 | 821a7e4143af115b840ec199eb179537e18af922 |
| linux | linux | >= 74451e66d516c55e309e8d89a4a1e7596e46aacd < 66d9111f3517f85ef2af0337ece02683ce0faf21 | 66d9111f3517f85ef2af0337ece02683ce0faf21 |
| linux | linux_kernel | < 5.10.202 | 5.10.202 |
| linux | linux_kernel | >= 0 < 5.10.205-1 | 5.10.205-1 |
| linux | linux_kernel | >= 0 < 6.1.64-1 | 6.1.64-1 |
| linux | linux_kernel | >= 0 < 6.6.8-1 | 6.6.8-1 |
| linux | linux_kernel | >= 0 < 6.6.8-1 | 6.6.8-1 |
| linux | linux_kernel | >= 5.11 < 5.15.140 | 5.15.140 |
| linux | linux_kernel | >= 5.16 < 6.1.64 | 6.1.64 |
| linux | linux_kernel | >= 6.2 < 6.5.13 | 6.5.13 |
| linux | linux_kernel | >= 6.6 < 6.6.3 | 6.6.3 |
CVSS provenance
nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv5.5MEDIUM
vendor_debian5.5MEDIUM
vendor_redhat5.5MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
GHSA-6j2j-fwgf-fcf6: In the Linux kernel, the following vulnerability has been resolved:
bpf: Detect IP == ksym
ghsa_unreviewed·2024-05-21
CVE-2023-52828 [MEDIUM] GHSA-6j2j-fwgf-fcf6: In the Linux kernel, the following vulnerability has been resolved:
bpf: Detect IP == ksym
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 th
OSV
CVE-2023-52828: In the Linux kernel, the following vulnerability has been resolved: bpf: Detect IP == ksym
osv·2024-05-21·CVSS 5.5
CVE-2023-52828 [MEDIUM] CVE-2023-52828: In the Linux kernel, the following vulnerability has been resolved: bpf: Detect IP == ksym
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
Red Hat
kernel: bpf: Detect IP == ksym.end as part of BPF program
vendor_redhat·2024-05-21·CVSS 5.5
CVE-2023-52828 [MEDIUM] CWE-561 kernel: bpf: Detect IP == ksym.end as part of BPF program
kernel: bpf: Detect IP == ksym.end as part of BPF program
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
Debian
CVE-2023-52828: linux - In the Linux kernel, the following vulnerability has been resolved: bpf: Detect...
vendor_debian·2023·CVSS 5.5
CVE-2023-52828 [MEDIUM] CVE-2023-52828: linux - In the Linux kernel, the following vulnerability has been resolved: bpf: Detect...
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
No detection rules found.
No public exploits indexed.
https://git.kernel.org/stable/c/327b92e8cb527ae097961ffd1610c720481947f5https://git.kernel.org/stable/c/6058e4829696412457729a00734969acc6fd1d18https://git.kernel.org/stable/c/66d9111f3517f85ef2af0337ece02683ce0faf21https://git.kernel.org/stable/c/821a7e4143af115b840ec199eb179537e18af922https://git.kernel.org/stable/c/aa42a7cb92647786719fe9608685da345883878fhttps://git.kernel.org/stable/c/cf353904a82873e952633fcac4385c2fcd3a46e1https://git.kernel.org/stable/c/327b92e8cb527ae097961ffd1610c720481947f5https://git.kernel.org/stable/c/6058e4829696412457729a00734969acc6fd1d18https://git.kernel.org/stable/c/66d9111f3517f85ef2af0337ece02683ce0faf21https://git.kernel.org/stable/c/821a7e4143af115b840ec199eb179537e18af922https://git.kernel.org/stable/c/aa42a7cb92647786719fe9608685da345883878fhttps://git.kernel.org/stable/c/cf353904a82873e952633fcac4385c2fcd3a46e1
2024-05-21
Published