diff options
author | Andrii Nakryiko <[email protected]> | 2023-07-07 16:11:56 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2023-07-08 18:29:53 -0700 |
commit | c628747cc8800cf6d33d09f7f42c8b6f91e64dc7 (patch) | |
tree | 73fdc51650ffd450e906045b5851d0f8f419ffe1 /drivers/fpga/fpga-mgr.c | |
parent | 856fe03d929205b4c8c8fa51296342cd85592e3f (diff) |
libbpf: only reset sec_def handler when necessary
Don't reset recorded sec_def handler unconditionally on
bpf_program__set_type(). There are two situations where this is wrong.
First, if the program type didn't actually change. In that case original
SEC handler should work just fine.
Second, catch-all custom SEC handler is supposed to work with any BPF
program type and SEC() annotation, so it also doesn't make sense to
reset that.
This patch fixes both issues. This was reported recently in the context
of breaking perf tool, which uses custom catch-all handler for fancy BPF
prologue generation logic. This patch should fix the issue.
[0] https://lore.kernel.org/linux-perf-users/[email protected]/
Fixes: d6e6286a12e7 ("libbpf: disassociate section handler on explicit bpf_program__set_type() call")
Reported-by: Ravi Bangoria <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions