linux_dsm_epyc7002/drivers/net/ethernet/intel/i40e
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
..
i40e_adminq_cmd.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_adminq.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_adminq.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_alloc.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_client.c i40e/i40evf: cleanup incorrect function doxygen comments 2018-04-30 09:09:04 -07:00
i40e_client.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_common.c i40e/i40evf: cleanup incorrect function doxygen comments 2018-04-30 09:09:04 -07:00
i40e_dcb_nl.c i40e/i40evf: cleanup incorrect function doxygen comments 2018-04-30 09:09:04 -07:00
i40e_dcb.c i40e: fix reading LLDP configuration 2018-04-30 09:12:33 -07:00
i40e_dcb.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_debugfs.c i40e/i40evf: cleanup incorrect function doxygen comments 2018-04-30 09:09:04 -07:00
i40e_devids.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_diag.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_diag.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_ethtool.c i40e: use the more traditional 'i' loop variable 2018-05-22 08:37:06 -07:00
i40e_hmc.c i40e/i40evf: cleanup incorrect function doxygen comments 2018-04-30 09:09:04 -07:00
i40e_hmc.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_lan_hmc.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_lan_hmc.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_main.c i40e: remove ndo_xdp_flush call i40e_xdp_flush 2018-06-05 14:03:15 +02:00
i40e_nvm.c i40e/i40evf: cleanup incorrect function doxygen comments 2018-04-30 09:09:04 -07:00
i40e_osdep.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_prototype.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_ptp.c i40e: free skb after clearing lock in ptp_stop 2018-05-22 08:37:06 -07:00
i40e_register.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_status.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_trace.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e_txrx.c bpf, xdp, i40e: fix i40e_build_skb skb reserve and truesize 2018-06-20 07:24:28 +09:00
i40e_txrx.h i40e: remove ndo_xdp_flush call i40e_xdp_flush 2018-06-05 14:03:15 +02:00
i40e_type.h i40e: fix reading LLDP configuration 2018-04-30 09:12:33 -07:00
i40e_virtchnl_pf.c i40e/i40evf: take into account queue map from vf when handling queues 2018-04-30 09:32:54 -07:00
i40e_virtchnl_pf.h net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
i40e.h i40e/i40evf: take into account queue map from vf when handling queues 2018-04-30 09:32:54 -07:00
Makefile net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00