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>] [day] [month] [year] [list]
Message-Id: <20230704042942.3984-1-duminjie@vivo.com>
Date:   Tue,  4 Jul 2023 12:29:42 +0800
From:   Minjie Du <duminjie@...o.com>
To:     Markus.Elfring@....de, richard@....at,
        anton.ivanov@...bridgegreys.com, johannes@...solutions.net,
        sfr@...b.auug.org.au, linux-um@...ts.infradead.org,
        linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Cc:     opensource.kernel@...o.com, Minjie Du <duminjie@...o.com>
Subject: [PATCH v3] um: vector: Replace undo_user_init in old code with out_free_netdev

Thanks for your response and suggestions,
I made some mistakes. This is a resubmitted patch.
I got some errors with my local repository,
so I lost the commit SHA-1 ID.
Fixes: ("drivers: use free_netdev before return in vector_eth_configure()")
Please check this link to see previous replies.
Link: https://lore.kernel.org/all/8854675f-99e7-314e-c986-8dc954ee4a27@web.de/

This patch make out_free_netdev replace undo_user_init,
fix etherdev leak in error return path.


Signed-off-by: Minjie Du <duminjie@...o.com>
---
 arch/um/drivers/vector_kern.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 131b7cb29..7ae6ab8df 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1646,7 +1646,7 @@ static void vector_eth_configure(
 	err = register_netdevice(dev);
 	rtnl_unlock();
 	if (err)
-		goto out_undo_user_init;
+		goto out_free_netdev;
 
 	spin_lock(&vector_devices_lock);
 	list_add(&device->list, &vector_devices);
@@ -1654,8 +1654,6 @@ static void vector_eth_configure(
 
 	return;
 
-out_undo_user_init:
-	return;
 out_free_netdev:
 	free_netdev(dev);
 out_free_device:
-- 
2.39.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ