Article View: linux.kernel.netdev
Article #21131Re: [PATCH RFC net 0/3] net: fix stacked VLAN header corruption in TX offloads and OVS
From: Gabriel Goller
Date: Mon, 23 Nov 2026 15:35
Date: Mon, 23 Nov 2026 15:35
55 lines
10131 bytes
10131 bytes
On 11.11.2026 19:33, Ilya Maximets wrote:
> On 11/11/26 6:37 PM, Gabriel Goller wrote:
> > Since commit 938863727076 ("tc: adjust network header after 2nd vlan
> > push"), a second VLAN push leaves network_header pointing to the
> > in-band VLAN header. The igb driver TSO and OVS IP set actions still
> > expect the L3 header, so they write to the VLAN header and corrupt
> > the packet. Patch 1 restores the L3 header in validate_xmit_skb() for
> > CHECKSUM_PARTIAL packets, which covers packets tagged by tc or BPF.
> > Patch 2 restores it in OVS right after the push, before later actions
> > run. Patch 3 adds a KUnit test. tc classification after a push keeps
> > working.
> >
> > The kernel uses two conventions for skb->network_header when a packet
> > carries an in-band VLAN tag:
> >
> > * network_header points at the L3 header
> > * network_header points at the in-band VLAN header
> >
> > Since commit 938863727076 ("tc: adjust network header after 2nd vlan
> > push"), skb_vlan_push() uses the second convention when it pushes a
> > second tag. The flow dissector, and so tc flower, needs that layout to
> > classify the packet after the push. Drivers doing TSO or checksum
> > offload expect the first one. vlan_features_check() clears TSO for
> > multi-tagged packets, so most drivers fall back to software GSO, which
> > finds the L3 header itself. igb keeps TSO for these packets and reads
> > the IP header at skb->network_header, so it builds the TSO context from
> > the VLAN header and corrupts the packet. OVS set actions after a second
> > push write to the wrong header in the same way.
> >
> > Which convention should a packet with in-band VLAN tags follow? This
> > series keeps the tc layout, converts to L3 in validate_xmit_skb() for
> > CHECKSUM_PARTIAL packets, and restores L3 right after the push in OVS.
> > If L3 should hold everywhere instead, the flow dissector would need to
> > find in-band tags from mac_len, and skb_vlan_push() could go back to
> > its old behavior.
>
> IMO, having 'network_header' pointing to something that is not a network
> layer doesn't make much sense, and having two separate meanings for the
> same field is a recipe for more issues introduced or discovered later.
> Others may, of course, disagree.
I agree, a full implementation would have to revert:
938863727076 ("tc: adjust network header after 2nd vlan push")
then change the flow-dissector to not rely on network_header and find the
in-band vlan tags itself.
@Boris maybe?
> Best regards, Ilya Maximets.
Thanks,
Gabriel
Technical Details
Message-ID:
<awRbU3ZRECEqq8zm@luna.proxmox.com>Path:
mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369542-linux-kernel-netdev=dewy.ruReferences:
<20261111-net_restore_the-v1-0-6aaeffa601c9@proxmox.com> <488e10a9-ea28-41cf-9a8a-aa7431f6dd48@ovn.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-wdc.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369542-linux-kernel-netdev=dewy.ru From: g.goller@proxmox.com (Gabriel Goller) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH RFC net 0/3] net: fix stacked VLAN header corruption in TX offloads and OVS Date: Mon, 23 Nov 2026 16:35:20 +0100 Organization: Usenet Network Message-ID: <awRbU3ZRECEqq8zm@luna.proxmox.com> References: <20261111-net_restore_the-v1-0-6aaeffa601c9@proxmox.com> <488e10a9-ea28-41cf-9a8a-aa7431f6dd48@ovn.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Injection-Info: usenet.network; logging-data="3915589"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:GdvAYn8sWH1sKCA4I/mCHY5pJ9o= sha256:nePkNTyDZcGfCsGN8zp32RcFKjC8nyIi91rz/QhreSk= sha1:SKa/34JcZ3OpWnlh0fEh/ySAFUw= sha256:2BvrH9zmDZNc61cp9a6RVB9Qq87DMWU48vphnQ8Db1s= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 85E0B125DBD; Mon, 23 Nov 2026 18:35:47 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.951 X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fev85ezBIxSs; Mon, 23 Nov 2026 18:35:39 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369542-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=proxmox.com X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 5CDD3125DB9; Mon, 23 Nov 2026 18:35:32 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 6745630C49; Mon, 23 Nov 2026 15:35:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795448125; b=t452ZPtfKxkXH3ilBdlvvxuLetCf6r1/MYPaa6gvtdeTb565O0mggMqKliACV7+QYFVM h8440N5JAWnUfsiJsZZB76ufuDQff4UsopU5E24yLQJ+cB8iXQl2wMA6RhroKqVbIHCE9 izq6fJio6WwCKbZAwYWb5AenvRUNUH0e00aO66GEVXAc99ZWzbkGL8i8Y41M5L9infMUK QhscEfp1iqMWsYWzVyV7HbFvT6fLtsGRg0bcCfot5OmucPiIRLGhU8l8A+ch8Gcrdr5yp 6C6m99Nn4W/CyGbOGTwqILo+hOGS9OP1FQyznoeL/QkZcF8EpN3iuJbhuHpGgIOug2A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795448125; h=X-Original-To:Received:DMARC-Filter:Received:Date:From:To:Cc:Subject: Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help: List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent: X-Bm-Milter-Handled:X-Bm-Transport-Timestamp; bh=pF9wzKO7QpdVZiEm5sjWg86fJwPTS9jr8H8o/XbMXY0=; b=OY28lbvGBeyzRqxHceRf4/szieu8Zh8dXqW0EuIiciwX1RFivTLzrySjqEk8w+Twc4wA OR34DLBbDL6PqZ26+S5XBh+gbmlUit110jtm79gSgwPxGEF9SZ8LsX3hVkMC5ZHsLgoIx Hlt/wSjvtxWAPXRKBZUpIo3C57W965GkXlbwwYuKe4vb1rG376h3s4ZXkWvq0MG4c9LFq INVZ9vrYfOtmr1tFwRy8qhPo+Uh+5Z9SWo+/RXfkGo3rDZOIyxsZiNcidhdHy/i0jpn6J PbXbZheK2D6bzwHCkIxBXVrG4Wfz8k824bRKblLq6XsuBCmELVT32WojwIXsnihkH1A== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9217D606A681; Mon, 23 Nov 2026 15:35:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=94.136.29.106 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795448125; b=VXBZkLRVWBM9F+RlBzW47Sg9nRDoXKd2YZm+kGKJjNgm10CbFxO00r/WAckfhGkFgGHP 4cfp0Oy2vB1oxptdd+NwGLb1R9DQoc8MlkQzRu0TirWHA3vhKo/Ho1N7UUsuCg08CVBwg eUsakN+R8nFDus04qmmwghUuBrNsrKTsNMXNxxWWZ40lh4nxWOeS+wJGBkNkHf70R2JiV As1q8zYa1tiVMZZS29sIua4/3ER17eYa/q8Zya3DaTS9nnhE76Uf/XGkRPrOkDTyFmF2J gzZJJsPSpB5Cl5APRhkNKz0uKcPHqjSjSLCE3wY1UlLBwOxgIMlO4iBZXBtC4TUeFEw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795448125; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent: X-Bm-Milter-Handled:X-Bm-Transport-Timestamp; bh=pF9wzKO7QpdVZiEm5sjWg86fJwPTS9jr8H8o/XbMXY0=; b=wrHxAZ972voXEYF9MqbHy+76TGzuT/erf72h8C1R5COyBvxKh7chlQYqxMqd8TMthoD7 MJ25FZD0xXQMJ5vy+m/aM3StLbEBguB82uVeZ+gvtdWeQXClIc/8hkIr5I/8+xx76hh8L QSa3ucFPrY3DlTiyYrMUWSGmpCX4Ky+XlQIixrZBvhe8rlJMqLGFHi3Yh1OFpEMhC3DmA 7IHOmUQpQOM6rOkujB2po9jGbDAyp7bnTAC4FmQOqXn8tiTCl8OeyVGR2JoAVUnovXUrN 7l8y3ryD3tdfYWXSCmKkUz54S1Os8FQxuaoX1CW2xM8IV25QOhbamD24RYDYV5v0LZg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=proxmox.com; spf=pass smtp.mailfrom=proxmox.com; arc=none smtp.remote-ip=94.136.29.106 X-Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ECB7606A32D; Mon, 23 Nov 2026 15:35:23 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2ECB7606A32D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=proxmox.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proxmox.com X-Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 020694307B; Mon, 23 Nov 2026 16:35:22 +0100 (CET) X-Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, Boris Sukholitko <boris.sukholitko@broadcom.com>, Aaron Conole <aconole@redhat.com>, Eelco Chaudron <echaudro@redhat.com>, Shuah Khan <shuah@kernel.org>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <488e10a9-ea28-41cf-9a8a-aa7431f6dd48@ovn.org> X-User-Agent: NeoMutt/20260616 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795448121234