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] [day] [month] [year] [list]
Message-ID: <170679878841.4979.18209786390477643347@kwain>
Date: Thu, 01 Feb 2024 15:46:28 +0100
From: Antoine Tenart <atenart@...nel.org>
To: Tobias Waldekranz <tobias@...dekranz.com>, davem@...emloft.net, kuba@...nel.org
Cc: olteanv@...il.com, roopa@...dia.com, razor@...ckwall.org, bridge@...ts.linux.dev, netdev@...r.kernel.org, jiri@...nulli.us, ivecera@...hat.com
Subject: Re: [PATCH v2 net] net: bridge: switchdev: Skip MDB replays of pending events

Hello,

Quoting Tobias Waldekranz (2024-02-01 15:00:24)
>  
> @@ -677,22 +691,26 @@ br_switchdev_mdb_replay(struct net_device *br_dev, struct net_device *dev,
> -       rcu_read_lock();
> +       spin_lock_bh(&br->multicast_lock);

The two errors path below also need to be converted from rcu_read_unlock
to spin_unlock_bh.

You also probably need to s/rcu_dereference/mlock_dereference/ below
(not shown in the diff) now that this snippet is outside an rcu read
section.

>  
> -       hlist_for_each_entry_rcu(mp, &br->mdb_list, mdb_node) {
> +       hlist_for_each_entry(mp, &br->mdb_list, mdb_node) {
>                 struct net_bridge_port_group __rcu * const *pp;
>                 const struct net_bridge_port_group *p;
>  
>                 if (mp->host_joined) {
> -                       err = br_switchdev_mdb_queue_one(&mdb_list,
> +                       err = br_switchdev_mdb_queue_one(&mdb_list, dev, action,
>                                                          SWITCHDEV_OBJ_ID_HOST_MDB,
>                                                          mp, br_dev);
>                         if (err) {
> @@ -706,7 +724,7 @@ br_switchdev_mdb_replay(struct net_device *br_dev, struct net_device *dev,
>                         if (p->key.port->dev != dev)
>                                 continue;
>  
> -                       err = br_switchdev_mdb_queue_one(&mdb_list,
> +                       err = br_switchdev_mdb_queue_one(&mdb_list, dev, action,
>                                                          SWITCHDEV_OBJ_ID_PORT_MDB,
>                                                          mp, dev);
>                         if (err) {
> @@ -716,12 +734,7 @@ br_switchdev_mdb_replay(struct net_device *br_dev, struct net_device *dev,
>                 }
>         }
>  
> -       rcu_read_unlock();
> -
> -       if (adding)
> -               action = SWITCHDEV_PORT_OBJ_ADD;
> -       else
> -               action = SWITCHDEV_PORT_OBJ_DEL;
> +       spin_unlock_bh(&br->multicast_lock);

Thanks,
Antoine

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ