bpf: fix UAF of trampoline progs before image release - #13316
bpf: fix UAF of trampoline progs before image release#13316kernel-patches-daemon-bpf[bot] wants to merge 1 commit into
Conversation
|
Upstream branch: a13307e |
AI reviewed your patch. Please fix the bug or email reply why it's not a bug. In-Reply-To-Subject: |
|
Forwarding comment 5301281425 via email |
3083173 to
6d6454e
Compare
|
Upstream branch: a13307e |
arch_prepare_bpf_trampoline() embeds program pointers in the generated image and passes them to __bpf_prog_enter_recur(). After bpf_trampoline_update() replaces the image, bpf_tramp_image_put() can keep the old image executable past a normal RCU grace period. A detached non-sleepable prog can therefore be freed before a preempted task reaches rcu_read_lock_dont_migrate() in __bpf_prog_enter_recur(), leading to a use-after-free. Keep image-local prog refs and drop them from bpf_tramp_image_free(). Fixes: e21aa34 ("bpf: Fix fexit trampoline.") Reported-by: Sechang Lim <rhkrqnwk98@gmail.com> Signed-off-by: Junseo Lim <zirajs7@gmail.com>
2fec56b to
b3c63e7
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1146410 expired. Closing PR. |
Pull request for series with
subject: bpf: fix UAF of trampoline progs before image release
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1146410