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: <20230703160826.5wx5mmszr67hvjmw@skbuf>
Date:   Mon, 3 Jul 2023 19:08:26 +0300
From:   Vladimir Oltean <vladimir.oltean@....com>
To:     Ido Schimmel <idosch@...dia.com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Roopa Prabhu <roopa@...dia.com>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Vlad Yasevich <vyasevic@...hat.com>,
        bridge@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: bridge: keep ports without IFF_UNICAST_FLT in
 BR_PROMISC mode

On Mon, Jul 03, 2023 at 11:00:14AM +0300, Ido Schimmel wrote:
> On Fri, Jun 30, 2023 at 07:41:18PM +0300, Vladimir Oltean wrote:
> > diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
> > index 3f04b40f6056..2450690f98cf 100644
> > --- a/net/bridge/br_if.c
> > +++ b/net/bridge/br_if.c
> > @@ -166,8 +166,9 @@ void br_manage_promisc(struct net_bridge *br)
> >  			 * This lets us disable promiscuous mode and write
> >  			 * this config to hw.
> >  			 */
> > -			if (br->auto_cnt == 0 ||
> > -			    (br->auto_cnt == 1 && br_auto_port(p)))
> > +			if ((p->dev->priv_flags & IFF_UNICAST_FLT) &&
> > +			    (br->auto_cnt == 0 ||
> > +			     (br->auto_cnt == 1 && br_auto_port(p))))
> >  				br_port_clear_promisc(p);
> >  			else
> >  				br_port_set_promisc(p);
> 
> IIUC, you are basically saying "If the port does not support unicast
> filtering, then set it to promiscuous mode right away instead of waiting
> for the addition of the first FDB entry to trigger it."

Correct.

> If so, LGTM.
> 
> Reviewed-by: Ido Schimmel <idosch@...dia.com>
> 
> Tested using [1].
> 
> Before:
> 
> # ~/tmp/promisc_repo.sh 
> 0
> 
> After:
> 
> # ~/tmp/promisc_repo.sh 
> 1
> 
> [1]
> #!/bin/bash
> 
> ip link add name swp1 type dummy
> ip link add name br1 type bridge vlan_filtering 1
> ip link set dev swp1 master br1
> ip -d -j -p link show dev swp1 | jq '.[]["promiscuity"]'

Thanks for testing.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ