bpf: Fix UAF in bpf_trampoline_multi_attach_free on update failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix UAF in bpf_trampoline_multi_attach_free on update failure
When bpf_trampoline_update() fails before modify_fentry_multi()/ unregister_fentry_multi() is called, cur_image is unchanged (cur_image == old_image) and ftrace still calls into it. Freeing old_image in that case causes a UAF.
Only free old_image when it differs from cur_image.
From the CVE record · Linux
The Linux kernel's BPF trampoline can free an image that ftrace still calls when a trampoline update fails before the fentry modification or unregistration step. This causes a use-after-free. The input does not specify how an attacker could trigger the failure or whether access or user interaction is required.
Engineers running the Linux kernel should check their installations; affected versions are not specified.