]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: XDP_REDIRECT should check IFF_UP and MTU
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Fri, 6 Jul 2018 02:49:00 +0000 (11:49 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 7 Jul 2018 22:25:35 +0000 (15:25 -0700)
commit0eb8b61a3baafdcf26e72911fcc397c143894d31
tree57cdc7f8d2c55996b0ca1b6e74a8de8fa997b29f
parentc50e120489453b1fa81e6e20908c3691ea4b9da6
xdp: XDP_REDIRECT should check IFF_UP and MTU

Otherwise we end up with attempting to send packets from down devices
or to send oversized packets, which may cause unexpected driver/device
behaviour. Generic XDP has already done this check, so reuse the logic
in native XDP.

Fixes: 5db98bdfe2b5 ("xdp: add bpf_redirect helper function")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/filter.h
kernel/bpf/devmap.c
net/core/filter.c