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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250325141723.499850-3-i.abramov@mt-integration.ru>
Date: Tue, 25 Mar 2025 17:17:21 +0300
From: Ivan Abramov <i.abramov@...integration.ru>
To: "David S. Miller" <davem@...emloft.net>
CC: Ivan Abramov <i.abramov@...integration.ru>, Jakub Kicinski
	<kuba@...nel.org>, <netdev@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<lvc-project@...uxtesting.org>
Subject: [PATCH net 2/4] ieee802154: Avoid calling WARN_ON() on -ENOMEM in cfg802154_pernet_exit()

It's pointless to call WARN_ON() in case of an allocation failure in
device_rename(), since it only leads to useless splats caused by deliberate
fault injections, so avoid it.

Fixes: 66e5c2672cd1 ("ieee802154: add netns support")
Signed-off-by: Ivan Abramov <i.abramov@...integration.ru>
---
 net/ieee802154/core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c
index f9865eb2c7cf..77760ed4e528 100644
--- a/net/ieee802154/core.c
+++ b/net/ieee802154/core.c
@@ -351,11 +351,14 @@ static struct notifier_block cfg802154_netdev_notifier = {
 static void __net_exit cfg802154_pernet_exit(struct net *net)
 {
 	struct cfg802154_registered_device *rdev;
+	int err;
 
 	rtnl_lock();
 	list_for_each_entry(rdev, &cfg802154_rdev_list, list) {
-		if (net_eq(wpan_phy_net(&rdev->wpan_phy), net))
-			WARN_ON(cfg802154_switch_netns(rdev, &init_net));
+		if (net_eq(wpan_phy_net(&rdev->wpan_phy), net)) {
+			err = cfg802154_switch_netns(rdev, &init_net);
+			WARN_ON(err && err != -ENOMEM);
+		}
 	}
 	rtnl_unlock();
 }
-- 
2.39.5


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ