]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: Fix handling of devmap in generic XDP
authorToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Thu, 14 Jun 2018 02:07:42 +0000 (11:07 +0900)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 15 Jun 2018 21:47:15 +0000 (23:47 +0200)
commit3584dc7fdd14c63f6b91a58e7e21d78654cdf107
tree29028cc0eb4f60c5c822a6fd4096c193376cf5dd
parent2f436d4ad5b2d8af866bae8938a5d23354dd55e7
xdp: Fix handling of devmap in generic XDP

Commit b1e3fdb79138 ("bpf: devmap introduce dev_map_enqueue") changed
the return value type of __devmap_lookup_elem() from struct net_device *
to struct bpf_dtab_netdev * but forgot to modify generic XDP code
accordingly.

Thus generic XDP incorrectly used struct bpf_dtab_netdev where struct
net_device is expected, then skb->dev was set to invalid value.

v2:
- Fix compiler warning without CONFIG_BPF_SYSCALL.

Fixes: b1e3fdb79138 ("bpf: devmap introduce dev_map_enqueue")
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
include/linux/filter.h
kernel/bpf/devmap.c
net/core/filter.c