diff options
author | Yonghong Song <[email protected]> | 2023-08-21 22:00:53 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-08-22 09:43:55 -0700 |
commit | ab6c637ad0276e42f8acabcbc64932a6d346dab3 (patch) | |
tree | 949811202c1bf84feed08e2606739abfabd6db19 /tools/perf/scripts/python | |
parent | d56518380085d78f179cdc701d791ace4acb1d23 (diff) |
bpf: Fix a bpf_kptr_xchg() issue with local kptr
When reviewing local percpu kptr support, Alexei discovered a bug
wherea bpf_kptr_xchg() may succeed even if the map value kptr type and
locally allocated obj type do not match ([1]). Missed struct btf_id
comparison is the reason for the bug. This patch added such struct btf_id
comparison and will flag verification failure if types do not match.
[1] https://lore.kernel.org/bpf/20230819002907.io3iphmnuk43xblu@macbook-pro-8.dhcp.thefacebook.com/#t
Reported-by: Alexei Starovoitov <[email protected]>
Fixes: 738c96d5e2e3 ("bpf: Allow local kptrs to be exchanged via bpf_kptr_xchg")
Signed-off-by: Yonghong Song <[email protected]>
Acked-by: Kumar Kartikeya Dwivedi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions