lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <169272716651.1975370.10514711233878278884.stgit@firesoul>
Date: Tue, 22 Aug 2023 19:59:26 +0200
From: Jesper Dangaard Brouer <hawk@...nel.org>
To: netdev@...r.kernel.org, edumazet@...gle.com
Cc: Jesper Dangaard Brouer <hawk@...nel.org>, pabeni@...hat.com,
 kuba@...nel.org, davem@...emloft.net, lorenzo@...nel.org,
 Ilias Apalodimas <ilias.apalodimas@...aro.org>, mtahhan@...hat.com,
 huangjie.albert@...edance.com, Yunsheng Lin <linyunsheng@...wei.com>,
 Liang Chen <liangchen.linux@...il.com>
Subject: [PATCH net-next RFC v1 4/4] veth: when XDP is loaded increase
 needed_headroom

When sending (sendmsg) SKBs out an veth device, the SKB headroom is too small
to satisfy XDP on the receiving veth peer device.

For AF_XDP (normal non-zero-copy) it is worth noticing that xsk_build_skb()
adjust headroom according to dev->needed_headroom. Other parts of the kernel
also take this into account (see macro LL_RESERVED_SPACE).

This solves the XDP_PACKET_HEADROOM check in veth_convert_skb_to_xdp_buff().

Signed-off-by: Jesper Dangaard Brouer <hawk@...nel.org>
---
 drivers/net/veth.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 8e117cc44fda..3630e9124071 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1649,6 +1649,7 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog,
 		if (!old_prog) {
 			peer->hw_features &= ~NETIF_F_GSO_SOFTWARE;
 			peer->max_mtu = max_mtu;
+			veth_set_rx_headroom(dev, XDP_PACKET_HEADROOM);
 		}
 
 		xdp_features_set_redirect_target(peer, true);
@@ -1666,6 +1667,7 @@ static int veth_xdp_set(struct net_device *dev, struct bpf_prog *prog,
 				peer->hw_features |= NETIF_F_GSO_SOFTWARE;
 				peer->max_mtu = ETH_MAX_MTU;
 			}
+			veth_set_rx_headroom(dev, -1);
 		}
 		bpf_prog_put(old_prog);
 	}



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ