diff options
author | Lorenz Bauer <[email protected]> | 2020-06-29 10:56:25 +0100 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2020-06-30 10:46:38 -0700 |
commit | 1b514239e85965cc4df085180a73dd91733135f7 (patch) | |
tree | 8a677a5b7ae15b977369200727eb37980ef300b4 /tools/perf/scripts/python/stackcollapse.py | |
parent | 951f38cf08350884e72e0936adf147a8d764cc5d (diff) |
bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH
Using BPF_PROG_ATTACH on a flow dissector program supports neither
target_fd, attach_flags or replace_bpf_fd but accepts any value.
Enforce that all of them are zero. This is fine for replace_bpf_fd
since its presence is indicated by BPF_F_REPLACE. It's more
problematic for target_fd, since zero is a valid fd. Should we
want to use the flag later on we'd have to add an exception for
fd 0. The alternative is to force a value like -1. This requires
more changes to tests. There is also precedent for using 0,
since bpf_iter uses this for target_fd as well.
Fixes: b27f7bb590ba ("flow_dissector: Move out netns_bpf prog callbacks")
Signed-off-by: Lorenz Bauer <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions