Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377AbbDJAuP (ORCPT ); Thu, 9 Apr 2015 20:50:15 -0400 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]:33725 "EHLO tama50.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751938AbbDJAuM (ORCPT ); Thu, 9 Apr 2015 20:50:12 -0400 Message-ID: <55271E36.5050309@lab.ntt.co.jp> Date: Fri, 10 Apr 2015 09:49:58 +0900 From: Toshiaki Makita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: lizf@kernel.org, stable@vger.kernel.org CC: linux-kernel@vger.kernel.org, "David S. Miller" , Zefan Li Subject: Re: [PATCH 3.4 077/176] net: Fix stacked vlan offload features computation References: <1428569028-23762-1-git-send-email-lizf@kernel.org> <1428569224-23820-77-git-send-email-lizf@kernel.org> In-Reply-To: <1428569224-23820-77-git-send-email-lizf@kernel.org> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2182 Lines: 59 On 2015/04/09 17:45, lizf@kernel.org wrote: > From: Toshiaki Makita > > 3.4.107-rc1 review patch. If anyone has any objections, please let me know. > > ------------------ > > > commit 796f2da81bead71ffc91ef70912cd8d1827bf756 upstream. > > When vlan tags are stacked, it is very likely that the outer tag is stored > in skb->vlan_tci and skb->protocol shows the inner tag's vlan_proto. > Currently netif_skb_features() first looks at skb->protocol even if there > is the outer tag in vlan_tci, thus it incorrectly retrieves the protocol > encapsulated by the inner vlan instead of the inner vlan protocol. > This allows GSO packets to be passed to HW and they end up being > corrupted. > > Fixes: 58e998c6d239 ("offloading: Force software GSO for multiple vlan tags.") > Signed-off-by: Toshiaki Makita > Signed-off-by: David S. Miller > [lizf: Backported to 3.4: > - remove ETH_P_8021AD > - pass protocol to harmonize_features()] > Signed-off-by: Zefan Li > --- > net/core/dev.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 0770364..f783dd3 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -2149,6 +2149,14 @@ netdev_features_t netif_skb_features(struct sk_buff *skb) > } else if (!vlan_tx_tag_present(skb)) { > return harmonize_features(skb, protocol, features); > } > + if (!vlan_tx_tag_present(skb)) { > + if (unlikely(protocol == htons(ETH_P_8021Q))) { > + struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; > + protocol = veh->h_vlan_encapsulated_proto; > + } else { > + return harmonize_features(skb, protocol, features); > + } > + } This does not look like a correct fix. We need to replace the existing check rather than add a new check, like this: https://lkml.org/lkml/2015/2/16/649 Thanks, Toshiaki Makita -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/