diff options
| author | Martin KaFai Lau <[email protected]> | 2019-05-31 22:29:11 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2019-06-03 20:38:48 +0000 |
| commit | 4ac30c4b3659efac031818c418beb51e630d512d (patch) | |
| tree | c595332075bea5ffdc4905627b2e632c9b638fb9 /tools/bpf/bpftool/prog.c | |
| parent | bpf, riscv: clear high 32 bits for ALU32 add/sub/neg/lsh/rsh/arsh (diff) | |
| download | kernel-4ac30c4b3659efac031818c418beb51e630d512d.tar.gz kernel-4ac30c4b3659efac031818c418beb51e630d512d.zip | |
bpf: udp: ipv6: Avoid running reuseport's bpf_prog from __udp6_lib_err
__udp6_lib_err() may be called when handling icmpv6 message. For example,
the icmpv6 toobig(type=2). __udp6_lib_lookup() is then called
which may call reuseport_select_sock(). reuseport_select_sock() will
call into a bpf_prog (if there is one).
reuseport_select_sock() is expecting the skb->data pointing to the
transport header (udphdr in this case). For example, run_bpf_filter()
is pulling the transport header.
However, in the __udp6_lib_err() path, the skb->data is pointing to the
ipv6hdr instead of the udphdr.
One option is to pull and push the ipv6hdr in __udp6_lib_err().
Instead of doing this, this patch follows how the original
commit 538950a1b752 ("soreuseport: setsockopt SO_ATTACH_REUSEPORT_[CE]BPF")
was done in IPv4, which has passed a NULL skb pointer to
reuseport_select_sock().
Fixes: 538950a1b752 ("soreuseport: setsockopt SO_ATTACH_REUSEPORT_[CE]BPF")
Cc: Craig Gallek <[email protected]>
Signed-off-by: Martin KaFai Lau <[email protected]>
Acked-by: Song Liu <[email protected]>
Acked-by: Craig Gallek <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions
