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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Thu, 05 Jul 2007 14:54:33 -0700
From:	"Matt Carlson" <mcarlson@...adcom.com>
To:	"jamal" <hadi@...erus.ca>
cc:	"Robert Olsson" <Robert.Olsson@...a.slu.se>,
	"Evgeniy Polyakov" <johnpol@....mipt.ru>,
	"Krishna Kumar2" <krkumar2@...ibm.com>,
	"Gagan Arneja" <gaagaan@...il.com>, netdev@...r.kernel.org,
	"Rick Jones" <rick.jones2@...com>,
	"Sridhar Samudrala" <sri@...ibm.com>,
	"David Miller" <davem@...emloft.net>,
	"Jeff Garzik" <jeff@...zik.org>,
	"Michael Chan" <mchan@...adcom.com>
Subject: [PATCH] tg3: Fix VLAN tag corruption

This patch fixes a VLAN tag corruption bug introduced in the tx batching
modifications.

Signed-off-by: Matt Carlson <mcarlson@...adcom.com>
Signed-off-by: Michael Chan <mchan@...adcom.com>

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index be03cbd..cef9cbe 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3896,8 +3896,15 @@ struct tg3_tx_cbdata {
 static int tg3_prep_bug_frame(struct sk_buff *skb, struct net_device *dev)
 {
 	struct tg3_tx_cbdata *cb = TG3_SKB_CB(skb);
+	struct tg3 *tp = netdev_priv(dev);
+	u32 vlantag = 0;
+
+#if TG3_VLAN_TAG_USED
+	if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
+		vlantag = (TXD_FLAG_VLAN | (vlan_tx_tag_get(skb) << 16));
+#endif
 
-	cb->base_flags = 0;
+	cb->base_flags = vlantag;
 	cb->mss = skb_shinfo(skb)->gso_size;
 	if (cb->mss != 0) {
 		if (skb_header_cloned(skb) &&
@@ -3919,8 +3926,15 @@ static int tg3_prep_bug_frame(struct sk_buff *skb, struct net_device *dev)
 static int tg3_prep_frame(struct sk_buff *skb, struct net_device *dev)
 {
 	struct tg3_tx_cbdata *cb = TG3_SKB_CB(skb);
+	struct tg3 *tp = netdev_priv(dev);
+	u32 vlantag = 0;
+
+#if TG3_VLAN_TAG_USED
+	if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
+		vlantag = (TXD_FLAG_VLAN | (vlan_tx_tag_get(skb) << 16));
+#endif
 
-	cb->base_flags = 0;
+	cb->base_flags = vlantag;
 	cb->mss = skb_shinfo(skb)->gso_size;
 	if (cb->mss != 0) {
 		int tcp_opt_len, ip_tcp_len;
@@ -3985,13 +3999,6 @@ static int tg3_enqueue(struct sk_buff *skb, struct net_device *dev)
 	u32 len, entry;
 	struct tg3_tx_cbdata *cb = TG3_SKB_CB(skb);
 
-
-#if TG3_VLAN_TAG_USED
-	if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
-		cb->base_flags |= (TXD_FLAG_VLAN |
-			       (vlan_tx_tag_get(skb) << 16));
-#endif
-
 	entry = tp->tx_prod;
 	len = skb_headlen(skb);
 	/* Queue skb data, a.k.a. the main skb fragment. */
@@ -4187,11 +4194,6 @@ static int tg3_enqueue_buggy(struct sk_buff *skb, struct net_device *dev)
 			}
 		}
 	}
-#if TG3_VLAN_TAG_USED
-	if (tp->vlgrp != NULL && vlan_tx_tag_present(skb))
-		cb->base_flags |= (TXD_FLAG_VLAN |
-			       (vlan_tx_tag_get(skb) << 16));
-#endif
 	len = skb_headlen(skb);
 	entry = tp->tx_prod;
 


-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists