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] [day] [month] [year] [list]
Message-ID: <20250616-positive-vicugna-of-felicity-9239d9-mkl@pengutronix.de>
Date: Mon, 16 Jun 2025 15:34:40 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: 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>, 
	Andrew Lunn <andrew+netdev@...n.ch>, "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>, Frank Li <frank.li@....com>
Subject: Re: [PATCH net-next v2 07/10] net: fec: fec_enet_rx_queue(): replace
 manual VLAN header calculation with skb_vlan_eth_hdr()

On 16.06.2025 15:12:37, Andrew Lunn wrote:
> On Mon, Jun 16, 2025 at 01:42:08AM +0000, Wei Fang wrote:
> > > >  drivers/net/ethernet/freescale/fec_main.c | 3 +--
> > > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > > > b/drivers/net/ethernet/freescale/fec_main.c
> > > > index 6b456372de9a..f238cb60aa65 100644
> > > > --- a/drivers/net/ethernet/freescale/fec_main.c
> > > > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > > > @@ -1860,8 +1860,7 @@ fec_enet_rx_queue(struct net_device *ndev, u16
> > > queue_id, int budget)
> > > >  		    fep->bufdesc_ex &&
> > > >  		    (ebdp->cbd_esc & cpu_to_fec32(BD_ENET_RX_VLAN))) {
> > > >  			/* Push and remove the vlan tag */
> > > > -			struct vlan_hdr *vlan_header =
> > > > -					(struct vlan_hdr *) (data + ETH_HLEN);
> > > > +			struct vlan_ethhdr *vlan_header = skb_vlan_eth_hdr(skb);
> > > 
> > > This is not 'obviously correct', so probably the commit message needs expanding.
> > > 
> > > static inline struct vlan_ethhdr *skb_vlan_eth_hdr(const struct sk_buff *skb) {
> > > 	return (struct vlan_ethhdr *)skb->data; }
> > > 
> > > I can see a few lines early:
> > > 
> > > 		data = skb->data;
> > > 
> > > but what about the + ETH_HLEN?
> > > 
> > 
> > The type of vlan_header has been changed from "struct vlan_hdr *" to
> > "struct vlan_ethhdr *", so it is correct to use skb->data directly.
> 
> Doh! I missed that, sorry. Maybe extend the commit message, you
> mention skb_vlan_eth_hdr() but you could add something like
> 
> ... and change the type of vlan_header to struct vlan_ethhdr to take
> into account the ethernet header plus vlan header is returned.
> 
> With that, please add: Reviewed-by: Andrew Lunn <andrew@...n.ch>

Will do, thanks!

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ