Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: Fix prog_array UAF in __uprobe_perf_func()
Currently, the pointer stored in call->prog_array is loaded in __uprobe_perf_func(), with no RCU annotation and no RCU protection, so the loaded pointer can immediately be dangling. Later, bpf_prog_run_array_uprobe() starts a RCU-trace read-side critical section, but this is too late. It then uses rcu_dereference_check(), but this use of rcu_dereference_check() does not actually dereference anything. It looks like the intention was to pass a pointer to the member call->prog_array into bpf_prog_run_array_uprobe() and actually dereference the pointer in there. Fix the issue by actually doing that. Fixes: 8c7dcb8 ("bpf: implement sleepable uprobes by chaining gps") Cc: [email protected] Signed-off-by: Jann Horn <[email protected]>
- Loading branch information