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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7103daf2-5faa-4d2e-8e12-40cf7b4b574f@CMEXHTCAS1.ad.emulex.com>
Date:	Mon, 24 Feb 2014 12:20:40 +0530
From:	Somnath Kotur <somnath.kotur@...lex.com>
To:	<netdev@...r.kernel.org>
CC:	<davem@...emloft.net>,
	Vasundhara Volam <vasundhara.volam@...lex.com>,
	Sathya Perla <sathya.perla@...lex.com>,
	Somnath Kotur <somnath.kotur@...lex.com>
Subject: [PATCH net 3/5] be2net: Fix skb double free in be_xmit_wrokarounds() failure path

From: Vasundhara Volam <vasundhara.volam@...lex.com>

skb_padto(), skb_share_check() and __vlan_put_tag() routines free
skb when they return an error. This patch fixes be_xmit_workarounds()
to not free skb again in such cases.

Signed-off-by: Vasundhara Volam <vasundhara.volam@...lex.com>
Signed-off-by: Sathya Perla <sathya.perla@...lex.com>
Signed-off-by: Somnath Kotur <somnath.kotur@...lex.com>
---
 drivers/net/ethernet/emulex/benet/be_main.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 9e6d678..a9da6f9 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -927,7 +927,7 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
 	 */
 	if (unlikely(!BEx_chip(adapter) && skb->len <= 32)) {
 		if (skb_padto(skb, 36))
-			goto tx_drop;
+			goto err;
 		skb->len = 36;
 	}
 
@@ -959,7 +959,7 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
 	    vlan_tx_tag_present(skb)) {
 		skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan);
 		if (unlikely(!skb))
-			goto tx_drop;
+			goto err;
 	}
 
 	/* HW may lockup when VLAN HW tagging is requested on
@@ -981,12 +981,13 @@ static struct sk_buff *be_xmit_workarounds(struct be_adapter *adapter,
 	    be_vlan_tag_tx_chk(adapter, skb)) {
 		skb = be_insert_vlan_in_pkt(adapter, skb, skip_hw_vlan);
 		if (unlikely(!skb))
-			goto tx_drop;
+			goto err;
 	}
 
 	return skb;
 tx_drop:
 	dev_kfree_skb_any(skb);
+err:
 	return NULL;
 }
 
-- 
1.5.6.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ