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: <1612322024-93322-1-git-send-email-driverfuzzing@gmail.com>
Date:   Tue,  2 Feb 2021 21:13:43 -0600
From:   Wenjia Zhao <driverfuzzing@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     driverfuzzing@...il.com, Yisen Zhuang <yisen.zhuang@...wei.com>,
        Salil Mehta <salil.mehta@...wei.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 4/4] net: hns3: double free 'skb'

net: hns3: double free 'skb'

The false branch of (tx_ret == NETDEV_TX_OK) free the skb. However, the
kfree_skb(skb) in the out label will be execute when exits the function.
So the skb has a double-free bugs.

Remove the kfree_skb(skb) at line 269

Signed-off-by: Wenjia Zhao <driverfuzzing@...il.com>
---
 drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 2622e04..1b926ff 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -266,7 +266,6 @@ static int hns3_lp_run_test(struct net_device *ndev, enum hnae3_loop mode)
 		if (tx_ret == NETDEV_TX_OK) {
 			good_cnt++;
 		} else {
-			kfree_skb(skb);
 			netdev_err(ndev, "hns3_lb_run_test xmit failed: %d\n",
 				   tx_ret);
 		}
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ