linux/drivers/net/ethernet/intel
Daniel Borkmann c51818d5b7 bpf, xdp, i40e: fix i40e_build_skb skb reserve and truesize
Using skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start))
is clearly wrong since I40E_SKB_PAD already points to the offset where
the original xdp->data was sitting since xdp->data_hard_start is defined
as xdp->data - i40e_rx_offset(rx_ring) where latter offsets to I40E_SKB_PAD
when build skb is used.

However, also before cc5b114dcf ("bpf, i40e: add meta data support")
this seems broken since bpf_xdp_adjust_head() helper could have been used
to alter headroom and enlarge / shrink the frame and with that the assumption
that the xdp->data remains unchanged does not hold and would push a bogus
packet to upper stack.

ixgbe got this right in 9247080816 ("ixgbe: add XDP support for pass and
drop actions"). In any case, fix it by removing the I40E_SKB_PAD from both
skb_reserve() and truesize calculation.

Fixes: cc5b114dcf ("bpf, i40e: add meta data support")
Fixes: 0c8493d90b ("i40e: add XDP support for pass and drop actions")
Reported-by: Keith Busch <keith.busch@linux.intel.com>
Reported-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Björn Töpel <bjorn.topel@intel.com>
Cc: John Fastabend <john.fastabend@gmail.com>
Tested-by: Keith Busch <keith.busch@linux.intel.com>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Acked-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-20 07:24:28 +09:00
..
e1000 treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
e1000e treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
fm10k treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
i40e bpf, xdp, i40e: fix i40e_build_skb skb reserve and truesize 2018-06-20 07:24:28 +09:00
i40evf i40evf: Fix a hardware reset support in VF driver 2018-05-14 07:05:16 -07:00
ice ice: Update NVM AQ command functions 2018-05-17 09:14:09 -07:00
igb treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
igbvf net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
ixgb treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
ixgbe Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-16 07:39:34 +09:00
ixgbevf treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
e100.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
Kconfig ice: Add basic driver framework for Intel(R) E800 Series 2018-03-26 08:28:02 -07:00
Makefile ice: Add basic driver framework for Intel(R) E800 Series 2018-03-26 08:28:02 -07:00