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-next>] [day] [month] [year] [list]
Message-ID: <tencent_4B358ADB8A54F04A32CD9933114B8B383606@qq.com>
Date: Thu, 27 Mar 2025 02:11:17 +0800
From: inuc@...com
To: bridge@...ts.linux.dev
Cc: netdev@...r.kernel.org,
	roopa@...dia.com,
	razor@...ckwall.org,
	Liu Jie <inuc@...com>
Subject: [PATCH] net: bridge: set skb->protocol for 802.1Q VLAN packets

From: Liu Jie <inuc@...com>

When bridging locally originated VLAN-tagged packets, we must ensure
skb->protocol is properly set to ETH_P_8021Q. Currently, if this field
remains unset, br_allowed_ingress() may incorrectly drop valid VLAN
packets during the bridge transmission path.

Fix this by explicitly checking eth_hdr(skb)->h_proto for VLAN tags when
handling locally generated packets.

Signed-off-by: Liu Jie <inuc@...com>
---
 net/bridge/br_device.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 0ab4613aa..9094ba7e4 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -63,6 +63,9 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
 	skb_reset_mac_header(skb);
 	skb_pull(skb, ETH_HLEN);
 
+	if (eth_hdr(skb)->h_proto == htons(ETH_P_8021Q))
+		skb->protocol = htons(ETH_P_8021Q);
+
 	if (!br_allowed_ingress(br, br_vlan_group_rcu(br), skb, &vid,
 				&state, &vlan))
 		goto out;
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ