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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250723171947.76995990@kernel.org>
Date: Wed, 23 Jul 2025 17:19:47 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Meghana Malladi <m-malladi@...com>
Cc: <namcao@...utronix.de>, <jacob.e.keller@...el.com>, <sdf@...ichev.me>,
 <john.fastabend@...il.com>, <hawk@...nel.org>, <daniel@...earbox.net>,
 <ast@...nel.org>, <pabeni@...hat.com>, <edumazet@...gle.com>,
 <davem@...emloft.net>, <andrew+netdev@...n.ch>, <bpf@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
 <linux-arm-kernel@...ts.infradead.org>, <srk@...com>, Vignesh Raghavendra
 <vigneshr@...com>, Roger Quadros <rogerq@...nel.org>, <danishanwar@...com>
Subject: Re: [PATCH net] net: ti: icssg-prueth: Fix skb handling for
 XDP_PASS

On Mon, 21 Jul 2025 18:19:18 +0530 Meghana Malladi wrote:
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c
> index 12f25cec6255..a0e7def33e8e 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_common.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c
> @@ -757,15 +757,12 @@ static int emac_rx_packet(struct prueth_emac *emac, u32 flow_id, u32 *xdp_state)
>  		xdp_prepare_buff(&xdp, pa, PRUETH_HEADROOM, pkt_len, false);
>  
>  		*xdp_state = emac_run_xdp(emac, &xdp, page, &pkt_len);
> -		if (*xdp_state == ICSSG_XDP_PASS)
> -			skb = xdp_build_skb_from_buff(&xdp);
> -		else
> +		if (*xdp_state != ICSSG_XDP_PASS)
>  			goto requeue;
> -	} else {
> -		/* prepare skb and send to n/w stack */
> -		skb = napi_build_skb(pa, PAGE_SIZE);
>  	}
>  
> +	/* prepare skb and send to n/w stack */
> +	skb = napi_build_skb(pa, PAGE_SIZE);
>  	if (!skb) {
>  		ndev->stats.rx_dropped++;
>  		page_pool_recycle_direct(pool, page);

I'm not sure this is correct. We seem to hardcode headroom to
PRUETH_HEADROOM lower in this function. If XDP adds or removes
network headers and then returns XDP_PASS we'll look for the packet 
at the wrong offset.

We just merged some XDP tests, could you try running 
tools/testing/selftests/drivers/net/xdp.py ? 
Some general instructions can be found here:
https://github.com/linux-netdev/nipa/wiki/Running-driver-tests

Not sure how stable the test is for all NICs but I think the 
 xdp.test_xdp_native_adjst_head_grow_data
test case will exercise what I'm suspecting will fail.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ