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: <875xjtb5o9.fsf@email.froward.int.ebiederm.org>
Date: Fri, 28 Mar 2025 09:17:42 -0500
From: "Eric W. Biederman" <ebiederm@...ssion.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: <i.abramov@...integration.ru>,  <aleksander.lobakin@...el.com>,
  <davem@...emloft.net>,  <edumazet@...gle.com>,  <horms@...nel.org>,
  <jdamato@...tly.com>,  <kuba@...nel.org>,  <leitao@...ian.org>,
  <linux-kernel@...r.kernel.org>,  <lvc-project@...uxtesting.org>,
  <netdev@...r.kernel.org>,  <pabeni@...hat.com>,
  <syzbot+1df6ffa7a6274ae264db@...kaller.appspotmail.com>
Subject: Re: [PATCH] net: Avoid calling WARN_ON() on -ENOMEM in
 __dev_change_net_namespace()

Kuniyuki Iwashima <kuniyu@...zon.com> writes:

>> 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@...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.

No.  It is not pointless.  The WARN_ON is there because the code can not
rollback if device_rename fails in
__dev_change_net_namespace/netif_change_net_namespace.

If device_rename fails it means that the kernel's device tree
are inconsistent with the actual network devices.

If anything we need a way to guarantee that the device_rename will
succeed, so that all of the parts that may fail may be performed
before we commit ourselves by notifying userspace that the device
is being renamed.

As for Breno Leitao <leitao@...ian.org>'s question should we fail
immediately.  That will put us in a far worse state.

As I recall the WARN_ON exists there because someone at the last minute
stuffed network devices into sysfs, and no one has taken the time to
handle the practically impossible case of a device_rename failure.

If you are going to do something with this logic please figure out how
to handle a failure instead just shutting up the error message that
let's you know something bad is wrong in the kernel.

Eric


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ