From nobody Thu Apr 10 23:20:23 2025 Received: from ksmg01.maxima.ru (ksmg01.mt-integration.ru [81.200.124.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22C7B24BC1A; Thu, 3 Apr 2025 10:20:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=81.200.124.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743675607; cv=none; b=DMuRj8ts327MvNeUurB42OEtBGIkE4L18f41E2zVJMGA3O89HAFMknh8tRhOTPPr5cd9fP8zRpXQ+NAUhj2cQQIbKFDRiN4NYU6Mt4SG2QYPbWYjIzEtz3f1W7dOm0sHUoAuWsh1x7wHtO0HiPMWVufmU/6l9qfPknxlPnZXZwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743675607; c=relaxed/simple; bh=ZH7Mtjj1ggJj5jnb35am/azc74GJhaWDqKuPUJKl0o8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OUMDFIFnKuBfAZPjaqyaxEa9WXjbSYcb3b3A8hoLjIMeY8pYZkCLkIBVqYJvCBF9fVms0Fp8/G58h1C/bSP2FwwHsxoH4hq3lzg7QeCy5zUPwDc/UBkQeRpnnrv+8jKzeZCSBSYc0G7DJpGKahft/fdC5sVmgzRqgnZm8EhYmec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mt-integration.ru; spf=pass smtp.mailfrom=mt-integration.ru; dkim=pass (2048-bit key) header.d=mt-integration.ru header.i=@mt-integration.ru header.b=O9AhvuB4; arc=none smtp.client-ip=81.200.124.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mt-integration.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt-integration.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt-integration.ru header.i=@mt-integration.ru header.b="O9AhvuB4" Received: from ksmg01.maxima.ru (localhost [127.0.0.1]) by ksmg01.maxima.ru (Postfix) with ESMTP id 2E233C0016; Thu, 3 Apr 2025 13:19:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 ksmg01.maxima.ru 2E233C0016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt-integration.ru; s=sl; t=1743675595; bh=mc5hecyNwgfepkhkE786/9n2mN+1R1/mTWRWxmAD3/c=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=O9AhvuB4GNYnfx9i8i7mHeb+JZPe7G4o/xR3Q3HDyQVRRMnaMTtImm7BzxGJz9Bkz BP/E+wVj3dDWilMKAMcjI4AXBJkNUDLvBiT67AcJ5xnaHAYO7LBsNn/K9bLbjGCH6+ jK/t8RZsyQ/a+A7+LR4nNy7Jmx8SBGgmFcY0JhCnOz51FJ785BpxcrRhpc+hUZnYrv SLjIfx6a84QIFXzwrVt189tJhcDaQuWq+xJLz7wlLydKXnc2j4ZpRY9CPgPopJZgMG Cs5dH/K93NvwbRjXC0jMCqWd00Os8lexgp56pFP/SBfytBVrb/wwFN8MprHT71xeWY TBqJAMkg8uALQ== Received: from ksmg01.maxima.ru (mail.maxima.ru [81.200.124.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.maxima.ru", Issuer "GlobalSign GCC R3 DV TLS CA 2020" (verified OK)) by ksmg01.maxima.ru (Postfix) with ESMTPS; Thu, 3 Apr 2025 13:19:55 +0300 (MSK) Received: from db126-1-abramov-14-d-mosos.mti-lab.com (172.25.20.118) by mmail-p-exch01.mt.ru (81.200.124.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 3 Apr 2025 13:19:54 +0300 From: Ivan Abramov To: Alexander Aring CC: Ivan Abramov , Miquel Raynal , Stefan Schmidt , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , , , , Subject: [PATCH net v3 1/3] ieee802154: Restore initial state on failed device_rename() in cfg802154_switch_netns() Date: Thu, 3 Apr 2025 13:19:32 +0300 Message-ID: <20250403101935.991385-2-i.abramov@mt-integration.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250403101935.991385-1-i.abramov@mt-integration.ru> References: <20250403101935.991385-1-i.abramov@mt-integration.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: mmail-p-exch02.mt.ru (81.200.124.62) To mmail-p-exch01.mt.ru (81.200.124.61) X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Auth: dmarc=none header.from=mt-integration.ru;spf=none smtp.mailfrom=mt-integration.ru;dkim=none X-KSMG-AntiSpam-Envelope-From: i.abramov@mt-integration.ru X-KSMG-AntiSpam-Info: LuaCore: 54 0.3.54 464169e973265e881193cca5ab7aa5055e5b7016, {rep_avail}, {Tracking_from_domain_doesnt_match_to}, ksmg01.maxima.ru:7.1.1;mt-integration.ru:7.1.1;127.0.0.199:7.1.2;81.200.124.61:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 81.200.124.61 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiSpam-Lua-Profiles: 192331 [Apr 03 2025] X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Version: 6.1.1.11 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.1.8310, bases: 2025/04/03 07:23:00 #27851719 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 7 Content-Type: text/plain; charset="utf-8" Currently, the return value of device_rename() is not acted upon. To avoid an inconsistent state in case of failure, roll back the changes made before the device_rename() call. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 66e5c2672cd1 ("ieee802154: add netns support") Reviewed-by: Miquel Raynal Signed-off-by: Ivan Abramov --- v3: Add Reviewed-by tag. v2: Make sure to commit against latest netdev/net. net/ieee802154/core.c | 45 ++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c index 89b671b12600..84d514430e45 100644 --- a/net/ieee802154/core.c +++ b/net/ieee802154/core.c @@ -233,31 +233,36 @@ int cfg802154_switch_netns(struct cfg802154_registere= d_device *rdev, wpan_dev->netdev->netns_immutable =3D true; } =20 - if (err) { - /* failed -- clean up to old netns */ - net =3D wpan_phy_net(&rdev->wpan_phy); - - list_for_each_entry_continue_reverse(wpan_dev, - &rdev->wpan_dev_list, - list) { - if (!wpan_dev->netdev) - continue; - wpan_dev->netdev->netns_immutable =3D false; - err =3D dev_change_net_namespace(wpan_dev->netdev, net, - "wpan%d"); - WARN_ON(err); - wpan_dev->netdev->netns_immutable =3D true; - } - - return err; - } - - wpan_phy_net_set(&rdev->wpan_phy, net); + if (err) + goto errout; =20 err =3D device_rename(&rdev->wpan_phy.dev, dev_name(&rdev->wpan_phy.dev)); WARN_ON(err); =20 + if (err) + goto errout; + + wpan_phy_net_set(&rdev->wpan_phy, net); + return 0; + +errout: + /* failed -- clean up to old netns */ + net =3D wpan_phy_net(&rdev->wpan_phy); + + list_for_each_entry_continue_reverse(wpan_dev, + &rdev->wpan_dev_list, + list) { + if (!wpan_dev->netdev) + continue; + wpan_dev->netdev->netns_immutable =3D false; + err =3D dev_change_net_namespace(wpan_dev->netdev, net, + "wpan%d"); + WARN_ON(err); + wpan_dev->netdev->netns_immutable =3D true; + } + + return err; } =20 void cfg802154_dev_free(struct cfg802154_registered_device *rdev) --=20 2.39.5 From nobody Thu Apr 10 23:20:23 2025 Received: from ksmg01.maxima.ru (ksmg01.maxima.ru [81.200.124.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 156FA24A062; Thu, 3 Apr 2025 10:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=81.200.124.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743675603; cv=none; b=UP7yuZbvsjlhj6ATq6yLxodQ/F5xvKDKcxmJJsOZhClmmTeWD/f+LrxIIXLPFPYc+NceqVr+2jQqSKtEnt9J9dUJDFXMmmHtGR6Q3ukwTjDNKaBepXgSYU9W5eZLnqxe9dZG9H1rczQbkMP5+XGQ/MRm/5bAuc8QBujnEoF3f3I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743675603; c=relaxed/simple; bh=CN+4u5oaSieWiujChEGNUUr3/wFpxNLN6MOHqNup4hE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=d0ZvDxWlBrOjrcqM+prpdy7BO8LzXltiDHXpoWEjEZ5Os/2xOWO6J6b8felrfKCZuWNHYZJ4OHbJ/Hus/NVHSx9qBEJM345QaaMRahq0SauJtiBNh0k9Cb6revSaaUxgwZqIjiw9ZOhtry+GjjqksfhNIqtFSa9A9NS2u86I9tA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mt-integration.ru; spf=pass smtp.mailfrom=mt-integration.ru; dkim=pass (2048-bit key) header.d=mt-integration.ru header.i=@mt-integration.ru header.b=X+f0gCjT; arc=none smtp.client-ip=81.200.124.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mt-integration.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt-integration.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt-integration.ru header.i=@mt-integration.ru header.b="X+f0gCjT" Received: from ksmg01.maxima.ru (localhost [127.0.0.1]) by ksmg01.maxima.ru (Postfix) with ESMTP id 4F3C5C0019; Thu, 3 Apr 2025 13:19:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 ksmg01.maxima.ru 4F3C5C0019 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt-integration.ru; s=sl; t=1743675597; bh=J+0Urg1F3a3sSGeN7fIcxtanqSTTESu1GrZeOZUoO5I=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=X+f0gCjTnRxm/sAmglRytxLPKktbaPgXAhWdRQm7CCREtjIAQtVGF3Og18Mcv+QO8 paPBcsbnQHsMZ84aoHKOuS9mozjmle0ep84IEiinRucwIKdJkH06vtDWxm39mMJkz2 nzscN+oW0aNP9byx6XsPqOx2DyULy0ZeB1QmROsEUiidFREjyiVIBShhznQ3ww7zCB o/ofyPEtxHlXv90/DdDYq/3am4siEp9lZbo7O2BcEUzZ+h2TpIhQlYaVDJQxPY0S2+ i/83g0IOV4OnWSyGAl5OaMPIsuBcmPRAiqYOswnwJ4/Yd6eMySZOb1jSoI4eHrrj74 yzrgl/88neDYg== Received: from ksmg01.maxima.ru (mail.maxima.ru [81.200.124.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.maxima.ru", Issuer "GlobalSign GCC R3 DV TLS CA 2020" (verified OK)) by ksmg01.maxima.ru (Postfix) with ESMTPS; Thu, 3 Apr 2025 13:19:57 +0300 (MSK) Received: from db126-1-abramov-14-d-mosos.mti-lab.com (172.25.20.118) by mmail-p-exch01.mt.ru (81.200.124.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 3 Apr 2025 13:19:56 +0300 From: Ivan Abramov To: Alexander Aring CC: Ivan Abramov , , Kuniyuki Iwashima , Miquel Raynal , Stefan Schmidt , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , , , , Subject: [PATCH net v3 2/3] ieee802154: Avoid calling WARN_ON() on -ENOMEM in cfg802154_switch_netns() Date: Thu, 3 Apr 2025 13:19:33 +0300 Message-ID: <20250403101935.991385-3-i.abramov@mt-integration.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250403101935.991385-1-i.abramov@mt-integration.ru> References: <20250403101935.991385-1-i.abramov@mt-integration.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: mmail-p-exch02.mt.ru (81.200.124.62) To mmail-p-exch01.mt.ru (81.200.124.61) X-KSMG-AntiPhishing: NotDetected, bases: 2025/04/03 09:28:00 X-KSMG-AntiSpam-Auth: dmarc=none header.from=mt-integration.ru;spf=none smtp.mailfrom=mt-integration.ru;dkim=none X-KSMG-AntiSpam-Envelope-From: i.abramov@mt-integration.ru X-KSMG-AntiSpam-Info: LuaCore: 54 0.3.54 464169e973265e881193cca5ab7aa5055e5b7016, {rep_avail}, {Tracking_uf_ne_domains}, {Tracking_from_domain_doesnt_match_to}, ksmg01.maxima.ru:7.1.1;lore.kernel.org:7.1.1;mt-integration.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;81.200.124.61:7.1.2, FromAlignment: s, ApMailHostAddress: 81.200.124.61 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiSpam-Lua-Profiles: 192331 [Apr 03 2025] X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Version: 6.1.1.11 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.1.8310, bases: 2025/04/03 07:23:00 #27851719 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected, bases: 2025/04/03 09:28:00 X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 7 Content-Type: text/plain; charset="utf-8" It's pointless to call WARN_ON() in case of an allocation failure in dev_change_net_namespace() and device_rename(), since it only leads to useless splats caused by deliberate fault injections, so avoid it. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 66e5c2672cd1 ("ieee802154: add netns support") Reported-by: syzbot+e0bd4e4815a910c0daa8@syzkaller.appspotmail.com Closes: https://lore.kernel.org/netdev/000000000000f4a1b7061f9421de@google.= com/#t Reviewed-by: Kuniyuki Iwashima Reviewed-by: Miquel Raynal Signed-off-by: Ivan Abramov --- v3: Add Reviewed-by tags. v2: Add Reported-by and Closes tags as per Kuniyuki Iwashima's observation. Make sure to commit against latest netdev/net. net/ieee802154/core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c index 84d514430e45..987c633e2c54 100644 --- a/net/ieee802154/core.c +++ b/net/ieee802154/core.c @@ -228,8 +228,10 @@ int cfg802154_switch_netns(struct cfg802154_registered= _device *rdev, continue; wpan_dev->netdev->netns_immutable =3D false; err =3D dev_change_net_namespace(wpan_dev->netdev, net, "wpan%d"); - if (err) + if (err) { + WARN_ON(err && err !=3D -ENOMEM); break; + } wpan_dev->netdev->netns_immutable =3D true; } =20 @@ -237,7 +239,7 @@ int cfg802154_switch_netns(struct cfg802154_registered_= device *rdev, goto errout; =20 err =3D device_rename(&rdev->wpan_phy.dev, dev_name(&rdev->wpan_phy.dev)); - WARN_ON(err); + WARN_ON(err && err !=3D -ENOMEM); =20 if (err) goto errout; @@ -258,7 +260,7 @@ int cfg802154_switch_netns(struct cfg802154_registered_= device *rdev, wpan_dev->netdev->netns_immutable =3D false; err =3D dev_change_net_namespace(wpan_dev->netdev, net, "wpan%d"); - WARN_ON(err); + WARN_ON(err && err !=3D -ENOMEM); wpan_dev->netdev->netns_immutable =3D true; } =20 --=20 2.39.5 From nobody Thu Apr 10 23:20:23 2025 Received: from ksmg01.maxima.ru (ksmg01.maxima.ru [81.200.124.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECBD424A055; Thu, 3 Apr 2025 10:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=81.200.124.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743675602; cv=none; b=n2RToUnKIgfTDWgANE9nYGSYETRN2MPq2d5Kqbo8ZNejhEVc8pJy3BvuBg3hFZNba6Qwwh3C4GJdejIzHqf7K5VGFyxei363ZBdj0zAgXXGYHKdYI1PstXzf4QE80U6Zh7YOx0ETxvvQ7ikcDoe/+oSTf/P4cbLS1unpWupOiYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743675602; c=relaxed/simple; bh=RPXyeFu3hLGAwb60oZcpOdtZIfP7WSaxI6mPPTvu0Z8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VL1TSj6MZMsqTumVV6/lQnc7iTL4X8ToUlNfqsKIQ1Xv4d87eVQ4+BpLpsgewlz1NlMl9S5222bjt5zGdiom13JnKn1eD/oyURcUWVFr0qRUAHnVddoi9HZmAVTBbMM6bWg1dM7bPEWZYwMPnIb5EHXnsFShRe+9tmbDrmpZQII= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mt-integration.ru; spf=pass smtp.mailfrom=mt-integration.ru; dkim=pass (2048-bit key) header.d=mt-integration.ru header.i=@mt-integration.ru header.b=aXPUFQvb; arc=none smtp.client-ip=81.200.124.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mt-integration.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mt-integration.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mt-integration.ru header.i=@mt-integration.ru header.b="aXPUFQvb" Received: from ksmg01.maxima.ru (localhost [127.0.0.1]) by ksmg01.maxima.ru (Postfix) with ESMTP id CD814C001E; Thu, 3 Apr 2025 13:19:58 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 ksmg01.maxima.ru CD814C001E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mt-integration.ru; s=sl; t=1743675598; bh=N6N25JmQAuicJL+q493OEXAu4U2lX1+1kyO9BOM/ZaM=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=aXPUFQvbjl6QYqhi99iXBe5b1I2eLTBn8L1X24bXuzGRGzY2LJUw3PH9dh7dJDPde +1IWuSxf5N1sfjfITVh7a7i/94GnePJc809+JEVz5LtGqw+/VklOR1mcR3geCJaX2y gMOOBpRLPT1BPaNGu7YkTcygPpF3UD5Mr/T2tLcCoSFHR57aJDcG/5CinpGU1SVNqC 39lHdftaXOPLrA5wxVvC80z85slXGgybPTOWCknqVl4gAAXHkRxVBHsPMpxXNn4/m+ RPY+LZFFp7eF3GTxYBd5rcrshhycxXw3+93pwZyL6jxrnmej47cNYf38emkqrraSUA qz+nnqRPDCvog== Received: from ksmg01.maxima.ru (mail.maxima.ru [81.200.124.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.maxima.ru", Issuer "GlobalSign GCC R3 DV TLS CA 2020" (verified OK)) by ksmg01.maxima.ru (Postfix) with ESMTPS; Thu, 3 Apr 2025 13:19:58 +0300 (MSK) Received: from db126-1-abramov-14-d-mosos.mti-lab.com (172.25.20.118) by mmail-p-exch01.mt.ru (81.200.124.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 3 Apr 2025 13:19:57 +0300 From: Ivan Abramov To: Alexander Aring CC: Ivan Abramov , Miquel Raynal , Stefan Schmidt , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , , , , Subject: [PATCH net v3 3/3] ieee802154: Remove WARN_ON() in cfg802154_pernet_exit() Date: Thu, 3 Apr 2025 13:19:34 +0300 Message-ID: <20250403101935.991385-4-i.abramov@mt-integration.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250403101935.991385-1-i.abramov@mt-integration.ru> References: <20250403101935.991385-1-i.abramov@mt-integration.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: mmail-p-exch02.mt.ru (81.200.124.62) To mmail-p-exch01.mt.ru (81.200.124.61) X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Auth: dmarc=none header.from=mt-integration.ru;spf=none smtp.mailfrom=mt-integration.ru;dkim=none X-KSMG-AntiSpam-Envelope-From: i.abramov@mt-integration.ru X-KSMG-AntiSpam-Info: LuaCore: 54 0.3.54 464169e973265e881193cca5ab7aa5055e5b7016, {rep_avail}, {Tracking_from_domain_doesnt_match_to}, ksmg01.maxima.ru:7.1.1;mt-integration.ru:7.1.1;127.0.0.199:7.1.2;81.200.124.61:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, ApMailHostAddress: 81.200.124.61 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiSpam-Lua-Profiles: 192331 [Apr 03 2025] X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Version: 6.1.1.11 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.1.8310, bases: 2025/04/03 07:23:00 #27851719 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: NotDetected X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 7 Content-Type: text/plain; charset="utf-8" There's no need to call WARN_ON() in cfg802154_pernet_exit(), since every point of failure in cfg802154_switch_netns() is covered with WARN_ON(), so remove it. Found by Linux Verification Center (linuxtesting.org) with Syzkaller. Fixes: 66e5c2672cd1 ("ieee802154: add netns support") Reviewed-by: Miquel Raynal Signed-off-by: Ivan Abramov --- v3: Add Reviewed-by tag. v2: Make sure to commit against latest netdev/net. net/ieee802154/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c index 987c633e2c54..c0b8712018a1 100644 --- a/net/ieee802154/core.c +++ b/net/ieee802154/core.c @@ -358,7 +358,7 @@ static void __net_exit cfg802154_pernet_exit(struct net= *net) 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)); + cfg802154_switch_netns(rdev, &init_net); } rtnl_unlock(); } --=20 2.39.5