diff options
| author | Lorenz Bauer <[email protected]> | 2020-11-05 11:52:30 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-11-06 02:20:41 +0000 |
| commit | f9b7ff0d7f7a466a920424246e7ddc2b84c87e52 (patch) | |
| tree | 7df91abb77173377acb9dc37b7f89830cf6e3dc9 /tools/bpf/bpftool/prog.c | |
| parent | libbpf: Fix possible use after free in xsk_socket__delete (diff) | |
| download | kernel-f9b7ff0d7f7a466a920424246e7ddc2b84c87e52.tar.gz kernel-f9b7ff0d7f7a466a920424246e7ddc2b84c87e52.zip | |
tools/bpftool: Fix attaching flow dissector
My earlier patch to reject non-zero arguments to flow dissector attach
broke attaching via bpftool. Instead of 0 it uses -1 for target_fd.
Fix this by passing a zero argument when attaching the flow dissector.
Fixes: 1b514239e859 ("bpf: flow_dissector: Check value of unused flags to BPF_PROG_ATTACH")
Reported-by: Jiri Benc <[email protected]>
Signed-off-by: Lorenz Bauer <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Song Liu <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
| -rw-r--r-- | tools/bpf/bpftool/prog.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index d942c1e3372c..acdb2c245f0a 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -940,7 +940,7 @@ static int parse_attach_detach_args(int argc, char **argv, int *progfd, } if (*attach_type == BPF_FLOW_DISSECTOR) { - *mapfd = -1; + *mapfd = 0; return 0; } |
