linux/drivers/net
Jesper Dangaard Brouer 5c8572251f veth: Adjust hard_start offset on redirect XDP frames
When native XDP redirect into a veth device, the frame arrives in the
xdp_frame structure. It is then processed in veth_xdp_rcv_one(),
which can run a new XDP bpf_prog on the packet. Doing so requires
converting xdp_frame to xdp_buff, but the tricky part is that
xdp_frame memory area is located in the top (data_hard_start) memory
area that xdp_buff will point into.

The current code tried to protect the xdp_frame area, by assigning
xdp_buff.data_hard_start past this memory. This results in 32 bytes
less headroom to expand into via BPF-helper bpf_xdp_adjust_head().

This protect step is actually not needed, because BPF-helper
bpf_xdp_adjust_head() already reserve this area, and don't allow
BPF-prog to expand into it. Thus, it is safe to point data_hard_start
directly at xdp_frame memory area.

Fixes: 9fc8d518d9 ("veth: Handle xdp_frames in xdp napi ring")
Reported-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/bpf/158945338331.97035.5923525383710752178.stgit@firesoul
2020-05-14 21:21:54 -07:00
..
appletalk docs: networking: convert ltpc.txt to ReST 2020-04-30 12:56:36 -07:00
arcnet docs: networking: convert arcnet.txt to ReST 2020-04-28 14:38:38 -07:00
bonding Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux 2020-05-09 01:05:30 -07:00
caif docs: networking: convert caif files to ReST 2020-04-28 14:38:38 -07:00
can
dsa net: dsa: felix: fix incorrect clamp calculation for burst 2020-05-14 18:02:02 -07:00
ethernet net: netsec: Add support for XDP frame size 2020-05-14 21:21:54 -07:00
fddi docs: networking: convert skfp.txt to ReST 2020-04-30 12:56:38 -07:00
fjes
hamradio net: partially revert dynamic lockdep key changes 2020-05-04 12:05:56 -07:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-05-06 22:10:13 -07:00
ieee802154
ipa net: ipa: Remove ipa_endpoint_stop{,_rx_dma} again 2020-05-08 22:35:56 -07:00
ipvlan net: partially revert dynamic lockdep key changes 2020-05-04 12:05:56 -07:00
netdevsim
phy net: phy: mdio-moxart: remove unneeded include 2020-05-14 17:58:46 -07:00
plip docs: networking: convert PLIP.txt to ReST 2020-04-30 12:56:37 -07:00
ppp net: partially revert dynamic lockdep key changes 2020-05-04 12:05:56 -07:00
slip
team net: partially revert dynamic lockdep key changes 2020-05-04 12:05:56 -07:00
usb r8152: Use MAC address from device tree if available 2020-05-14 13:16:38 -07:00
vmxnet3
wan docs: networking: convert framerelay.txt to ReST 2020-04-28 14:39:46 -07:00
wimax wimax/i2400m: Fix potential urb refcnt leak 2020-04-18 15:00:22 -07:00
wireguard wireguard: send/receive: use explicit unlikely branch instead of implicit coalescing 2020-05-06 20:03:47 -07:00
wireless wireless-drivers-next patches for v5.8 2020-05-07 13:22:35 -07:00
xen-netback
bareudp.c
dummy.c
eql.c
geneve.c geneve: use the correct nlattr array in NL_SET_ERR_MSG_ATTR 2020-04-23 12:39:09 -07:00
gtp.c gtp: set NLM_F_MULTI flag in gtp_genl_dump_pdp() 2020-05-01 15:34:09 -07:00
ifb.c
Kconfig docs: networking: device drivers: convert sb1000.txt to ReST 2020-05-01 12:24:42 -07:00
LICENSE.SRC
loopback.c
macsec.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-05-06 22:10:13 -07:00
macvlan.c netpoll: accept NULL np argument in netpoll_send_skb() 2020-05-07 18:11:07 -07:00
macvtap.c
Makefile
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c rionet: Fix use correct return type for ndo_start_xmit() 2020-04-30 12:15:13 -07:00
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c
tun.c net: tun: record RX queue in skb before do_xdp_generic() 2020-04-12 20:58:24 -07:00
veth.c veth: Adjust hard_start offset on redirect XDP frames 2020-05-14 21:21:54 -07:00
virtio_net.c
vrf.c net: partially revert dynamic lockdep key changes 2020-05-04 12:05:56 -07:00
vsockmon.c
vxlan.c vxlan: use the correct nlattr array in NL_SET_ERR_MSG_ATTR 2020-04-23 12:39:09 -07:00
xen-netfront.c