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: <BY2PR03MB377A5CA16D09062CE761F0CF5180@BY2PR03MB377.namprd03.prod.outlook.com>
Date:	Tue, 10 Mar 2015 11:13:22 +0000
From:	"fugang.duan@...escale.com" <fugang.duan@...escale.com>
To:	Michael Grzeschik <mgr@...gutronix.de>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: RE: [PATCH] net: fec: fix receive VLAN CTAG HW acceleration issue

From: Michael Grzeschik <mgr@...gutronix.de> Sent: Tuesday, March 10, 2015 7:05 PM
> To: Duan Fugang-B38611
> Cc: davem@...emloft.net; netdev@...r.kernel.org; kernel@...gutronix.de
> Subject: Re: [PATCH] net: fec: fix receive VLAN CTAG HW acceleration
> issue
> 
> On Tue, Mar 10, 2015 at 06:30:42PM +0800, Fugang Duan wrote:
> > The current driver support receive VLAN CTAG HW acceleration feature
> > (NETIF_F_HW_VLAN_CTAG_RX) through software simulation. There calls the
> > api .skb_copy_to_linear_data_offset() to skip the VLAN tag, but there
> > have overlap between the two memory data point range. The patch just
> > fix the issue.
> >
> > Reported-by: Michael Grzeschik <m.grzeschik@...gutronix.de>
> > Signed-off-by: Fugang Duan <B38611@...escale.com>
> > ---
> >  drivers/net/ethernet/freescale/fec_main.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > b/drivers/net/ethernet/freescale/fec_main.c
> > index 9bb6220..c9b1dbb 100644
> > --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -1475,12 +1475,14 @@ fec_enet_rx_queue(struct net_device *ndev, int
> budget, u16 queue_id)
> >  			/* Push and remove the vlan tag */
> >  			struct vlan_hdr *vlan_header =
> >  					(struct vlan_hdr *) (data + ETH_HLEN);
> > +			unsigned char eth_hdr[12];
> >  			vlan_tag = ntohs(vlan_header->h_vlan_TCI);
> >
> >  			vlan_packet_rcvd = true;
> >
> > +			memcpy(eth_hdr, data, 2 * ETH_ALEN);
> >  			skb_copy_to_linear_data_offset(skb, VLAN_HLEN,
> > -						       data, (2 * ETH_ALEN));
> > +						       eth_hdr, (2 * ETH_ALEN));
> >  			skb_pull(skb, VLAN_HLEN);
> >  		}
> >
> > --
> > 1.7.8
> 
> why not just use memmove instead of the skb_copy_to_linear_data_offset?
> 
> memmove(skb->data + VLAN_HLEN, data, (2 * ETH_ALEN));
> 
> Michael


Good suggestion. Thanks. 

Regards,
Andy
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ