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:
 <PAXPR04MB8510AA11AD9BDD5CD94FCC8D88472@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Thu, 17 Oct 2024 03:19:42 +0000
From: Wei Fang <wei.fang@....com>
To: Marc Kleine-Budde <mkl@...gutronix.de>, Shenwei Wang
	<shenwei.wang@....com>, Clark Wang <xiaoning.wang@....com>, "David S. Miller"
	<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
	<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Richard Cochran
	<richardcochran@...il.com>
CC: "imx@...ts.linux.dev" <imx@...ts.linux.dev>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "kernel@...gutronix.de"
	<kernel@...gutronix.de>
Subject: RE: [PATCH net-next 11/13] net: fec: fec_enet_rx_queue(): reduce
 scope of data

> -----Original Message-----
> From: Marc Kleine-Budde <mkl@...gutronix.de>
> Sent: 2024年10月17日 5:52
> To: Wei Fang <wei.fang@....com>; Shenwei Wang <shenwei.wang@....com>;
> Clark Wang <xiaoning.wang@....com>; David S. Miller
> <davem@...emloft.net>; Eric Dumazet <edumazet@...gle.com>; Jakub
> Kicinski <kuba@...nel.org>; Paolo Abeni <pabeni@...hat.com>; Richard
> Cochran <richardcochran@...il.com>
> Cc: imx@...ts.linux.dev; netdev@...r.kernel.org; linux-kernel@...r.kernel.org;
> kernel@...gutronix.de; Marc Kleine-Budde <mkl@...gutronix.de>
> Subject: [PATCH net-next 11/13] net: fec: fec_enet_rx_queue(): reduce scope of
> data
> 
> In order to clean up of the VLAN handling, reduce the scope of data.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
> ---
>  drivers/net/ethernet/freescale/fec_main.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index
> fd7a78ec5fa8ac0f7d141779938a4690594dbef1..640fbde10861005e7e2eb23
> 358bfeaac49ec1792 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1686,7 +1686,6 @@ fec_enet_rx_queue(struct net_device *ndev, u16
> queue_id, int budget)
>  	unsigned short status;
>  	struct  sk_buff *skb;
>  	ushort	pkt_len;
> -	__u8 *data;
>  	int	pkt_received = 0;
>  	struct	bufdesc_ex *ebdp = NULL;
>  	bool	vlan_packet_rcvd = false;
> @@ -1803,10 +1802,11 @@ fec_enet_rx_queue(struct net_device *ndev, u16
> queue_id, int budget)
>  		skb_mark_for_recycle(skb);
> 
>  		if (unlikely(need_swap)) {
> +			u8 *data;
> +
>  			data = page_address(page) + FEC_ENET_XDP_HEADROOM;
>  			swap_buffer(data, pkt_len);
>  		}
> -		data = skb->data;
> 
>  		/* Extract the enhanced buffer descriptor */
>  		ebdp = NULL;
> @@ -1824,7 +1824,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16
> queue_id, int budget)
> 
>  			vlan_packet_rcvd = true;
> 
> -			memmove(skb->data + VLAN_HLEN, data, ETH_ALEN * 2);
> +			memmove(skb->data + VLAN_HLEN, skb->data, ETH_ALEN * 2);
>  			skb_pull(skb, VLAN_HLEN);
>  		}
> 
> 
> --
> 2.45.2
> 
Thanks

Reviewed-by: Wei Fang <wei.fang@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ