From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF0EA3ED3A0 for ; Tue, 19 May 2026 14:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779199687; cv=none; b=WJ8O3wc3euyCTpoyg9moh71i1+qmNWe9Ls/BPOqdh0naPhdkP+xemITaAjfLZLkkrWjxKF23FRraUiTynz4Ct3Dac7PVW1iEoYcK1xQ7TYMtlmrPxgxXAU0oPz/DtqDgOOEVBjeYLFU1C2PE/FB36HtZsteyJ7bJzOfU7ydP7k0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779199687; c=relaxed/simple; bh=zQtVbr85AngQnhh2R72U4pYPTS8w4FUXhvz6OVz6VEQ=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=O73bb6QZmZgf5QIIdSYz6Amp2HaAueMcbK2CnviRpDJmQGoqKOPIkw3j648croKIcD9Truk5+s7fuBlGJDMF5d3IrulHQzsTLuMJo3mAbOaXkU+p65i3FmIdOX+zUgKHtm4nn82qKK+I00/NlDpl80xCLsI6bLQzMYwji7HUQSk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.167.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-47e80ab61a5so6093615b6e.3 for ; Tue, 19 May 2026 07:08:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779199685; x=1779804485; h=content-transfer-encoding:to:from:subject:message-id:in-reply-to :date:mime-version:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BTgrjoJYeCjgKtPZ83fcLxTHT+ujHH9nZy7D0FwExys=; b=gBTctRdtYHzgE3bbZRm0ND/8Ip2KLyPsinU2VJeMbHh8EMEYaluiDGO3CFzaYVNDAx WxZra61NCWbRtAXwTKYm+fTHjmKGHCeZgXb+gZ/qyC+rq1zz1s9UH6sTOUf8J6FxNDZ9 YNSuCBST32ZcMAls1RgPyqzyA99Jz8si0G8UC5SUbZc4HsHC30l9j2PdOPj9wgTW+p7N Ekjo7ZfzK7+6uujycpV56YUxtKhDHDp1YePm6AhWgLny3ua5M3Ud9BxBAVsaaUwW6SRR gl8kMY2TG9wyXIUmm+kmuMXgHP1uJ/agHPyjzFC0PLBRE6jZfo1iqDFNuYJYiaPiKrLh 1sAA== X-Gm-Message-State: AOJu0Yx2/pCT4hLRWjfjlzzyIWQ7n9J0yyfGLaK5BSGKBwwSO4Ir6BCr GTap3nEN/Flvez86c/j2nq/ZX9HDqg8JFAqBKUpTLeTwyroUwjIzzb/v8j0VAy+71vSodgKFoQS K4VX3mKmKNLEv9V6Tjv3mrJTNnGZTTnnVkEZFPJY16sW/h7/O5SP4s2/FwqA= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6808:1250:b0:479:f131:c4f2 with SMTP id 5614622812f47-482e574701dmr11829516b6e.14.1779199684761; Tue, 19 May 2026 07:08:04 -0700 (PDT) Date: Tue, 19 May 2026 07:08:04 -0700 In-Reply-To: <675021af.050a0220.17bd51.0061.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a0c6ec4.170a0220.39a13.0003.GAE@google.com> Subject: Forwarded: Re: [PATCH RFC v2] wifi: cfg80211: replace WARN_ON() with dev_err() in netns switch From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: [PATCH RFC v2] wifi: cfg80211: replace WARN_ON() with dev_err(= ) in netns switch Author: nogikh@google.com Debugging went 100% astray because of an strace output in the repro run res= ults. #syz reject On Tue, May 19, 2026 at 12:08=E2=80=AFAM 'syzbot' via syzkaller-upstream-moderation wrote: > > The syzkaller reported a kernel panic in cfg802154_switch_netns() when > device_rename() fails with -ENOMEM. The crash occurs because WARN_ON() > is used to handle the memory allocation failure, which escalates into a > kernel panic when panic_on_warn is enabled. > > Memory allocation failures are expected runtime events under memory > pressure and should be handled gracefully. The WARN_ON() macro must not > be used for conditions that can legitimately happen. Failing to rename > the device or change the network namespace is not a fatal system error. > > Replace the WARN_ON() calls with dev_err() in both > cfg802154_switch_netns() and cfg80211_switch_netns(), as well as in > their respective pernet exit handlers (cfg802154_pernet_exit() and > cfg80211_pernet_exit()). This ensures that memory allocation failures > under pressure are handled gracefully, logging the error for debugging > purposes without bringing down the entire system. > > Fixes: 04600794958f1833f5571c6cde40f260ab557f55 ("cfg80211: support sysfs= namespaces") > Assisted-by: Gemini:gemini-3.1-pro-preview Gemini:gemini-3-flash-preview > Reported-by: syzbot+bd5829ba3619f08e2341@syzkaller.appspotmail.com > Link: https://syzkaller.appspot.com/bug?extid=3Dbd5829ba3619f08e2341 > Link: https://syzkaller.appspot.com/ai_job?id=3Da1cfc84c-7c0f-4340-891d-8= 85fcee80cad > To: > To: > To: > To: > To: > To: > To: > To: > To: > Cc: > Cc: > Cc: > Cc: > > --- > v2: > - Replaced pr_err() with dev_err() to include device details in the error= messages. > > v1: > https://lore.kernel.org/all/7d949fbc-9781-4428-bfac-e51501b18bf7@mail.ker= nel.org/T/ > --- > diff --git a/net/ieee802154/core.c b/net/ieee802154/core.c > index 89b671b12..07082857c 100644 > --- a/net/ieee802154/core.c > +++ b/net/ieee802154/core.c > @@ -245,7 +245,9 @@ int cfg802154_switch_netns(struct cfg802154_registere= d_device *rdev, > wpan_dev->netdev->netns_immutable =3D false; > err =3D dev_change_net_namespace(wpan_dev->netdev= , net, > "wpan%d"); > - WARN_ON(err); > + if (err) > + dev_err(&rdev->wpan_phy.dev, > + "failed to change netns: %d\n", e= rr); > wpan_dev->netdev->netns_immutable =3D true; > } > > @@ -255,7 +257,9 @@ int cfg802154_switch_netns(struct cfg802154_registere= d_device *rdev, > wpan_phy_net_set(&rdev->wpan_phy, net); > > err =3D device_rename(&rdev->wpan_phy.dev, dev_name(&rdev->wpan_p= hy.dev)); > - WARN_ON(err); > + if (err) > + dev_err(&rdev->wpan_phy.dev, "failed to rename device: %d= \n", > + err); > > return 0; > } > @@ -350,8 +354,11 @@ 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)); > + if (net_eq(wpan_phy_net(&rdev->wpan_phy), net)) { > + if (cfg802154_switch_netns(rdev, &init_net)) > + dev_err(&rdev->wpan_phy.dev, > + "failed to switch netns on exit\n= "); > + } > } > rtnl_unlock(); > } > diff --git a/net/wireless/core.c b/net/wireless/core.c > index 6783e0672..6badcec46 100644 > --- a/net/wireless/core.c > +++ b/net/wireless/core.c > @@ -184,7 +184,9 @@ int cfg80211_switch_netns(struct cfg80211_registered_= device *rdev, > wdev->netdev->netns_immutable =3D false; > err =3D dev_change_net_namespace(wdev->netdev, ne= t, > "wlan%d"); > - WARN_ON(err); > + if (err) > + dev_err(&rdev->wiphy.dev, > + "failed to change netns: %d\n", e= rr); > wdev->netdev->netns_immutable =3D true; > } > > @@ -204,7 +206,8 @@ int cfg80211_switch_netns(struct cfg80211_registered_= device *rdev, > wiphy_net_set(&rdev->wiphy, net); > > err =3D device_rename(&rdev->wiphy.dev, dev_name(&rdev->wiphy.dev= )); > - WARN_ON(err); > + if (err) > + dev_err(&rdev->wiphy.dev, "failed to rename device: %d\n"= , err); > > nl80211_notify_wiphy(rdev, NL80211_CMD_NEW_WIPHY); > > @@ -1809,8 +1812,11 @@ static void __net_exit cfg80211_pernet_exit(struct= net *net) > > rtnl_lock(); > for_each_rdev(rdev) { > - if (net_eq(wiphy_net(&rdev->wiphy), net)) > - WARN_ON(cfg80211_switch_netns(rdev, &init_net)); > + if (net_eq(wiphy_net(&rdev->wiphy), net)) { > + if (cfg80211_switch_netns(rdev, &init_net)) > + dev_err(&rdev->wiphy.dev, > + "failed to switch netns on exit\n= "); > + } > } > rtnl_unlock(); > } > > > base-commit: 5d6919055dec134de3c40167a490f33c74c12581 > -- > This is an AI-generated patch subject to moderation. > Reply with '#syz upstream' to send it to the mailing list. > Reply with '#syz reject' to reject it. > > See for more information. > > -- > You received this message because you are subscribed to the Google Groups= "syzkaller-upstream-moderation" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to syzkaller-upstream-moderation+unsubscribe@googlegroups.com. > To view this discussion visit https://groups.google.com/d/msgid/syzkaller= -upstream-moderation/4e2d36a7-9417-4c50-9ec1-3e82c7a670f3%40mail.kernel.org= . --=20 You received this message because you are subscribed to the Google Groups "= syzkaller-upstream-moderation" group. To unsubscribe from this group and stop receiving emails from it, send an e= mail to syzkaller-upstream-moderation+unsubscribe@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/syzkaller-u= pstream-moderation/CANp29Y5hQ8KXKdqe0CYqSk%3DNvLwwRZ0GwXhqj5FEhYFOz5g7nQ%40= mail.gmail.com.