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: <CANn89iL_fyHeEh0ymxYuSEtNg10wnzPbaOo06xToejMmDxRHNA@mail.gmail.com>
Date: Thu, 25 Jul 2024 13:53:27 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Shigeru Yoshida <syoshida@...hat.com>, davem@...emloft.net, kuba@...nel.org, 
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] macvlan: Return error on register_netdevice_notifier()
 failure

On Thu, Jul 25, 2024 at 12:13 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
>
>
> On 7/25/24 11:44, Eric Dumazet wrote:
> > On Wed, Jul 24, 2024 at 3:56 PM Shigeru Yoshida <syoshida@...hat.com> wrote:
> >>
> >> register_netdevice_notifier() may fail, but macvlan_init_module() does
> >> not handle the failure.  Handle the failure by returning an error.
> >
> > How could this fail exactly ? Please provide details, because I do not
> > think it can.
>
> Yup, it looks like the registration can't fail for macvlan.
>
> It's better to avoid adding unneeded checks, to reduce noise on the
> tree, keep stable backport easy, etc.

Shigeru, you could send a debug patch when net-next reopens next week,
so that we do not get another attempt
on fixing a non-existent bug.

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 24298a33e0e94851ebf9c704c723f25ac7bf5eec..0803fcf8df4c56ede10597c862288c7aa887160e
100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -1849,7 +1849,8 @@ static int __init macvlan_init_module(void)
 {
        int err;

-       register_netdevice_notifier(&macvlan_notifier_block);
+       err = register_netdevice_notifier(&macvlan_notifier_block);
+       DEBUG_NET_WARN_ON_ONCE(err < 0);

        err = macvlan_link_register(&macvlan_link_ops);
        if (err < 0)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ