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]
Date:	Fri, 14 Jun 2013 16:24:16 +0000
From:	Haiyang Zhang <haiyangz@...rosoft.com>
To:	Olaf Hering <olaf@...fle.de>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	KY Srinivasan <kys@...rosoft.com>,
	"jasowang@...hat.com" <jasowang@...hat.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>
Subject: RE: [PATCH net] hyperv: Fix vlan_proto setting in
 netvsc_recv_callback()



> -----Original Message-----
> From: Olaf Hering [mailto:olaf@...fle.de]
> Sent: Friday, June 14, 2013 11:29 AM
> To: Haiyang Zhang
> Cc: davem@...emloft.net; netdev@...r.kernel.org; KY Srinivasan;
> jasowang@...hat.com; linux-kernel@...r.kernel.org;
> devel@...uxdriverproject.org
> Subject: Re: [PATCH net] hyperv: Fix vlan_proto setting in
> netvsc_recv_callback()
> 
> On Tue, May 28, Haiyang Zhang wrote:
> 
> > Since the recent addition of 8021AD, we need to set the new field
> > vlan_proto in sk_buff. Otherwise, it will trigger BUG() call in
> vlan_proto_idx().
> 
> > @@ -284,7 +285,7 @@ int netvsc_recv_callback(struct hv_device
> > *device_obj,
> >
> >  	skb->protocol = eth_type_trans(skb, net);
> >  	skb->ip_summed = CHECKSUM_NONE;
> > -	skb->vlan_tci = packet->vlan_tci;
> > +	__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet-
> >vlan_tci);
> 
> 
> Just curious:
> 
> Doesnt that change behaviour in the sense that __vlan_hwaccel_put_tag()
> now always adds VLAN_TAG_PRESENT to skb->vlan_tci, while before that
> change packet->vlan_tci may or may not had this flag?
> 
> In other words, should a variant of this patch be backported if it was a bug
> not not use __vlan_hwaccel_put_tag right from the start?
> 

Thanks for looking at this. Actually, the previous code was correct, because I 
add the VLAN_TAG_PRESENT if the packet comes from vlan in function
rndis_filter_receive_data():
        if (vlan) {
                pkt->vlan_tci = VLAN_TAG_PRESENT | vlan->vlanid |
                        (vlan->pri << VLAN_PRIO_SHIFT);
        } else {
                pkt->vlan_tci = 0;
        }

But, the new code should be updated below, so the VLAN_TAG_PRESENT won't be set
when it's not from a vlan:
If (VLAN_TAG_PRESENT & packet->vlan_tci)
	__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet- vlan_tci);

I will submit a patch soon.

Thanks,
- Haiyang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ