๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #6745

Re: [PATCH 1/2] netfilter: bridge: refragment packets with a vlan tag moved by the bridge

#6745
From: netdev-bot+sashiko
Date: Fri, 23 Oct 2026 09:04
88 lines
10985 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The comment above nf_ct_bridge_frag_restore()
  (net/bridge/netfilter/nf_conntrack_bridge.c:396), "Actually only slowโ€ฆ

--

netfilter: bridge: refragment packets with a vlan tag moved by the bridge

With this patch, nf_ct_bridge_refrag() looks past a vlan tag that
br_allowed_ingress() moved into the packet after prerouting
defragmentation. It saves the tag, pulls it off, fragments the inner
IPv4 or IPv6 packet, and then pushes the tag back onto each fragment in
nf_ct_bridge_frag_restore() together with the outer protocol.

Closes: https://syzkaller.appspot.com/bug?extid=a8ba738fe2db6b4bb27f

> diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
> index b5444335b86f..e16071eb2df0 100644
> --- a/net/bridge/netfilter/nf_conntrack_bridge.c
> +++ b/net/bridge/netfilter/nf_conntrack_bridge.c

[ ... ]

> +		proto = data.inband_vlan_encap_proto;
> +		__skb_pull(skb, VLAN_HLEN);
> +		skb->protocol = proto;

[ ... ]

> @@ -371,11 +399,18 @@ static int nf_ct_bridge_frag_restore(struct sk_buff *skb,
>  {
>  	int err;
>  
> -	err = skb_cow_head(skb, ETH_HLEN);
> +	err = skb_cow_head(skb, ETH_HLEN + (data->inband_vlan_present ? VLAN_HLEN : 0));
>  	if (err) {
>  		kfree_skb(skb);
>  		return -ENOMEM;
>  	}
> +	if (data->inband_vlan_present) {
> +		struct vlan_hdr *vhdr = skb_push(skb, VLAN_HLEN);
> +
> +		vhdr->h_vlan_TCI = htons(data->inband_vlan_tci);
> +		vhdr->h_vlan_encapsulated_proto = data->inband_vlan_encap_proto;
> +		skb->protocol = data->inband_vlan_proto;
> +	}

[Severity: Low]
This isn't a bug, but the comment above nf_ct_bridge_frag_restore()
hasn't been changed and still says:

/* Actually only slow path refragmentation needs this. */

Now that nf_ct_bridge_refrag() pulls the vlan header and sets
skb->protocol to the inner ethertype before it picks the fast or slow
path, nf_ct_bridge_frag_restore() is the only code that pushes the
header back.

The frag_list fast paths also reach this function. nf_br_ip_fragment()
and br_ip6_fragment() call output() for the head skb and for each
fraglist member, and that leads to:

output()
  nf_ct_bridge_refrag_post()
    nf_ct_bridge_frag_restore()

Suppose a later change skipped the restore on the fast path, as the
comment suggests is fine. The head fragment would then go out without
its vlan header. data->mac would still hold the vlan TPID, and
skb->protocol would be IP or IPv6.

The comment was arguably wrong even before this patch, because
fraglist members also need the MAC copy and the hwaccel tag. Since the
fast path now depends on the vlan restore as well, could the comment be
updated or removed?

> 	if (data->vlan_present)
> 		__vlan_hwaccel_put_tag(skb, data->vlan_proto, data->vlan_tci);
> 	else if (skb_vlan_tag_present(skb))

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261020000308.37362-1-laveeshb%40laveeshbansal.com
Technical Details
Message-ID: <179274624590.3134.14861783086322416790@kernel.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350988-linux-kernel-netdev=dewy.ru
References: <20261020005403.38212-1-laveeshb@laveeshbansal.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350988-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH 1/2] netfilter: bridge: refragment packets with a vlan tag
 moved by the bridge
Date: Fri, 23 Oct 2026 09:04:05 +0000
Organization: Usenet Network
Message-ID: <179274624590.3134.14861783086322416790@kernel.org>
References: <20261020005403.38212-1-laveeshb@laveeshbansal.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="457612"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:jizzOoJmzJplineYkXL2Pl8XWJg= sha256:2d5Y78oTaofOkpXb2DthUSUPb/1GlGSwRBKaWXcinXc=
	sha1:PzQE9c+ZcjLktdJwv9ovCBcOqCA= sha256:2aMcnbAMrkMNoqq2J8wbNPD69Xil5L21kIyHZ/R0u2g=
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 91AD511144C; Fri, 23 Oct 2026 12:08:28 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.738
X-Spam-Status: No, score=-3.738 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 sZsjLhsBZl9g;
	Fri, 23 Oct 2026 12:08:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350988-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 35AFA11143E; Fri, 23 Oct 2026 12:08:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 592552A692; Fri, 23 Oct 2026 09:04:36 +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=1792746253;
	b=hsNIV0Y6k6KANvwCg7gDeWtPcaSegGG2tT3J6uFLYgvpwSwKj0v8Fmg+YcFYv5sB60Ay
	 vHiwX92KAG2XEZEdeA7x4LO/7L/3Zbv9BXQ2wuK4no8u0BOyKRaV7sLUnO58/fzqCvLMD
	 aZ0mUD4TY9zeLDOLSa/0NwaBUw1LUV+vpnqiK0LHML88NEgmuggHIO2zYhEEvs10efzA1
	 Wca7HT/WoOtCY22h9v2AH47Bui/YuHWaEg8vFWxVpU2MCwPqhRXcXR3cO7HsG31QW/Iz2
	 xy034pLmeJXp4TPX54gv9sKrrgov78WfuCRz0+49Upv6nN/Gf95XAx1fywKRvmjJOzA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792746253;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=hz1aS6k9JYTIHkVB4fRMXL70ayAGOm4KjPKMJxbKxoA=;
	b=32P8vJjnWojYFkPoz3ScAAzkbMHftUUApoG3eQsOFt232hjwMx0pmr6tBLQ7dAMlFTX/
	 OLOxXSDi+YLn8rXXaoKhFRnXxSkYcWBqlmknipygG5KpqmeG8t6hCg5x1oLspW0sl+9mP
	 5szvhMXT9/INqUUBdbiYqeD4r6z5jtg3hp/LbZptDsJNajF/tKOhXEI/y/6hF3BjDrAsY
	 LMnx/E+RU+LNwVYeGZl87fXu6bkXCDKGdJcOw7OiWG4nKKm3Obh/VkImvxxtlATGb3yIq
	 7tWrcyFZKrH3PVBtLIh9vgVbyWTpwRJyMEwoPwhzy2sMTQycEHyTgA/6q3Kx9W+1eEA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IO8VGDk7;
	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 6F46A60A2617;
	Fri, 23 Oct 2026 09:04:13 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IO8VGDk7
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792746247;
	b=IV+zXndMioVcEejX6eZDWSuZldauXIymh7U2rOEcAWtiZAwhEPtqgRghpB/Q2jd/Bv/t
	 p7hwTLwZ3cUBt5jctAz4vt+xgCRe2Nnr49aMZ8SBReUbOmKJ3oF71K9HjOG0u7xIfFFp2
	 zplUYRuYu7iLzMu4H4shpXGC+hiHYK4io7w7GMn/ojsT94Sg0E2uHzgGYWkIckohz9gPX
	 WAm3ogaqpIXDSxUS2uuapJZDpNHloanyvj2lEsfZBMAeJUadyKfCjNw3Y1NzBx0LFabYo
	 wwSyaKmsc0M6w3HVC0qwZya/NlE/CCz+Yg0faVfrt6Q6GNs481v0xlkmWDRTeFpsq4g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792746247;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=hz1aS6k9JYTIHkVB4fRMXL70ayAGOm4KjPKMJxbKxoA=;
	b=JolpTT3VTsp7Dh7hB5rYiH3FNq+5u1l6Z9XLZuTmisA+Id/d5AvkZYeFCnmmSC7cIPhv
	 YfvxA+jUSjI1ebxP9ZkV0KVgtAsBs0EAzjkl/u8VJpOCW11Ff6voxdfv7lZuC0wHDE/oy
	 hITF/6lJMpX2CxXH3LwQvJVHFIHc8JegG2mLMWE4YIliQkyX7X5KiGg21S3MEhp5pj1dY
	 ZOxFMje146x4Ovn3u8XNCo/vmvCrf04jT8uoAXc6heUiKPallRHDjy/h3mQqO3D/TnPwJ
	 wn72MxWhCL2FpzCt9DlNRJGCqweZbtUNTFK5405itJPD5+YiPR4HiRIQ7k+tNLLJ4TQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IO8VGDk7;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(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 3F418606A325;
	Fri, 23 Oct 2026 09:04:06 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A3EB1F01825;
	Fri, 23 Oct 2026 09:04:06 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1792746246;
	bh=hz1aS6k9JYTIHkVB4fRMXL70ayAGOm4KjPKMJxbKxoA=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=IO8VGDk7iqV49THZhE395BZDd0Dw0uBL2CUzMpxwWxpL6SfiisurgC5jq2w72H+Bt
	 MdoF+AeEG6lTfVp2Ky6uyi0/ABBohzd5zGhZgbbEZC3uYo+KqnctKqxS6/iJn59Zgv
	 vIaA9sAS5+mZasinB7xHWE11eKCu77q6xso+sn/nny17lXBiYfWNlmxWqOj8jmWCNk
	 c+JO41eyt+hOqCNTcJumemvhQnpPeqXhKBf1A8SKP87h24RD1giNfZDsofKfXW3hvR
	 vrYaBODrIoz4sQ2fnvvw8FQliBnbE6ENMx9q2guH9NzygNfzHmDGcSvKk0D7/DvkCx
	 djZSSaxIFRGFA==
X-Cc: pablo@netfilter.org, fw@strlen.de, razor@blackwall.org, idosch@nvidia.com,
 netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
 bridge@lists.linux.dev, netdev@vger.kernel.org, kuba@kernel.org
X-In-Reply-To: <20261020005403.38212-1-laveeshb@laveeshbansal.com>
X-sashiko-severity: Low
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