Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1509305ybd; Wed, 26 Jun 2019 19:29:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwICCRCyM+NekddBPvvCoOXMamo6zM6CZM+/R6ARHHmmgTPYhVphCeum1cIFiFMfv5PN/Qh X-Received: by 2002:a17:902:1486:: with SMTP id k6mr1574757pla.177.1561602558297; Wed, 26 Jun 2019 19:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561602558; cv=none; d=google.com; s=arc-20160816; b=UokmOaxvxgaVokmQNeWiyI/vammkcIZges11X0KtjBX3Hn5xESgKBmQw0ZbnOUJ4cM VovGHSQdOlEz8eZxvmXkhDE+00IBIqgdByxH72QdGSDszjJe4BxpOTzozGEGaxxro08v Cf5msb3iCjWpsd/KsAOR2DFCFHdOyk9qFxYOB4A9C5TbITVAgo4WIvL0/3Woinj7WpcN BXkGgeWvE72NLc4LY6WFoiVgEg8K5i1ghQYL5HyLj617KZQ0YXsJch1aLDWn9VNLXut9 i8hU9S0SLm1vddT3RRtAquGcqYtOgamyRROrAhrWKkvlVtR1ZxkxRD+BpfaLOZh5VZd+ Zueg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=oB5jq38Oe2OSncVF1uNJ+V1r6xRckEucZ2HUz+ypO1U=; b=plPc0BpBgZuOOLbXBFkxIOm5/k9iilkPoQzPYJDy4PsedjDF7Quagl7nM9WI7GDHvP aBxRM7g4qCF3e0dIl1ZC/2G3yQrMgg85QZfnvKekqrCh4LIxTClThslfDHzm1kBN8HKy 4oqw/mtavEXDdxgIP0HEWrrEloZoE4tPgD+6IOn0fXQitURXciMgPSP716SnDVe09tYj x5SD1etI5xgRvvRvqGA/4tjoNBXLrDkopYy2mMVLX+uwu0TaJ06sA2iy5VHr2M5QiBya pf+6pemMFFl2AOqVSi8e3YQf1Oz8O7ATpSsw9MIdNtPeRHc34HweCs4kDahe/qwkzQCJ mOTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r72si3665624pjb.33.2019.06.26.19.29.02; Wed, 26 Jun 2019 19:29:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727118AbfF0C25 (ORCPT + 99 others); Wed, 26 Jun 2019 22:28:57 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:45630 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbfF0C24 (ORCPT ); Wed, 26 Jun 2019 22:28:56 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 8E26414DE6387; Wed, 26 Jun 2019 19:28:53 -0700 (PDT) Date: Wed, 26 Jun 2019 19:28:29 -0700 (PDT) Message-Id: <20190626.192829.1694521513812984310.davem@davemloft.net> To: yuehaibing@huawei.com Cc: sdf@google.com, jianbol@mellanox.com, jiri@mellanox.com, mirq-linux@rere.qmqm.pl, willemb@google.com, sdf@fomichev.me, jiri@resnulli.us, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v2] flow_dissector: Fix vlan header offset in __skb_flow_dissect From: David Miller In-Reply-To: <20190624034913.40328-1-yuehaibing@huawei.com> References: <20190622.161955.2030310177158651781.davem@davemloft.net> <20190624034913.40328-1-yuehaibing@huawei.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 26 Jun 2019 19:28:53 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: YueHaibing Date: Mon, 24 Jun 2019 11:49:13 +0800 > @@ -998,6 +998,9 @@ bool __skb_flow_dissect(const struct net *net, > skb && skb_vlan_tag_present(skb)) { > proto = skb->protocol; > } else { > + if (dissector_vlan == FLOW_DISSECTOR_KEY_MAX) > + nhoff -= sizeof(*vlan); > + But this is wrong when we are being called via eth_get_headlen(), in that case nhoff will be sizeof(struct ethhdr).