From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <i.abramov@mt-integration.ru>
Cc: <aleksander.lobakin@intel.com>, <davem@davemloft.net>,
<ebiederm@xmission.com>, <edumazet@google.com>,
<horms@kernel.org>, <jdamato@fastly.com>, <kuba@kernel.org>,
<kuniyu@amazon.com>, <leitao@debian.org>,
<linux-kernel@vger.kernel.org>, <lvc-project@linuxtesting.org>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>,
<syzbot+1df6ffa7a6274ae264db@syzkaller.appspotmail.com>
Subject: Re: [PATCH] net: Avoid calling WARN_ON() on -ENOMEM in __dev_change_net_namespace()
Date: Thu, 27 Mar 2025 19:15:00 -0700 [thread overview]
Message-ID: <20250328022204.12804-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20250328011302.743860-1-i.abramov@mt-integration.ru>
> Subject: [PATCH] net: Avoid calling WARN_ON() on -ENOMEM in __dev_change_net_namespace()
s/__dev_change_net_namespace/netif_change_net_namespace/
Also, please specify the target tree: [PATCH v2 net]
From: Ivan Abramov <i.abramov@mt-integration.ru>
Date: Fri, 28 Mar 2025 04:12:57 +0300
> 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.
>
> Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
>
> Fixes: 8b41d1887db7 ("[NET]: Fix running without sysfs")
Reported-by: syzbot+1df6ffa7a6274ae264db@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/000000000000a45a92061ce6cc7d@google.com/
> Signed-off-by: Ivan Abramov <i.abramov@mt-integration.ru>
> ---
> net/core/dev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 2f7f5fd9ffec..14726cc8796b 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -12102,7 +12102,7 @@ int __dev_change_net_namespace(struct net_device *dev, struct net *net,
It applies cleanly but please make sure to use the latest tree.
> dev_set_uevent_suppress(&dev->dev, 1);
> err = device_rename(&dev->dev, dev->name);
> dev_set_uevent_suppress(&dev->dev, 0);
> - WARN_ON(err);
> + WARN_ON(err && err != -ENOMEM);
>
> /* Send a netdev-add uevent to the new namespace */
> kobject_uevent(&dev->dev.kobj, KOBJ_ADD);
> --
> 2.39.5
next prev parent reply other threads:[~2025-03-28 2:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-28 1:12 Ivan Abramov
2025-03-28 2:15 ` Kuniyuki Iwashima [this message]
2025-03-28 14:17 ` Eric W. Biederman
2025-03-31 9:17 ` Ivan Abramov
2025-03-28 13:25 ` Breno Leitao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250328022204.12804-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=aleksander.lobakin@intel.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=i.abramov@mt-integration.ru \
--cc=jdamato@fastly.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+1df6ffa7a6274ae264db@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®