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]
Date: Tue, 06 Feb 2024 10:19:19 +0100
From: Antoine Tenart <atenart@...nel.org>
To: David S . Miller <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: netdev@...r.kernel.org, eric.dumazet@...il.com, Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH v3 net-next 05/15] geneve: use exit_batch_rtnl() method

Quoting Eric Dumazet (2024-02-05 13:47:42)
> -static void __net_exit geneve_exit_batch_net(struct list_head *net_list)
> +static void __net_exit geneve_exit_batch_rtnl(struct list_head *net_list,
> +                                             struct list_head *dev_to_kill)
>  {
>         struct net *net;
> -       LIST_HEAD(list);
>  
> -       rtnl_lock();
>         list_for_each_entry(net, net_list, exit_list)
> -               geneve_destroy_tunnels(net, &list);
> -
> -       /* unregister the devices gathered above */
> -       unregister_netdevice_many(&list);
> -       rtnl_unlock();
> +               geneve_destroy_tunnels(net, dev_to_kill);
>  
>         list_for_each_entry(net, net_list, exit_list) {
>                 const struct geneve_net *gn = net_generic(net, geneve_net_id);

Not shown in the diff here is:

  WARN_ON_ONCE(!list_empty(&gn->sock_list));

I think this will be triggered as the above logic inverted two calls,
which are now,

1. WARN_ON_ONCE(...)
2. unregister_netdevice_many

But ->sock_list entries are removed in ndo_exit, called from
unregister_netdevice_many.

I guess the warning could be moved to exit_batch (or removed).

Thanks,
Antoine

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ