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:   Fri, 27 Oct 2017 17:24:27 +0900
From:   Toshiaki Makita <makita.toshiaki@....ntt.co.jp>
To:     Nikolay Aleksandrov <nikolay@...ulusnetworks.com>,
        netdev@...r.kernel.org
Cc:     roopa@...ulusnetworks.com, dsa@...ulusnetworks.com,
        davem@...emloft.net, bridge@...ts.linux-foundation.org,
        mrv@...atatu.com, stephen@...workplumber.org
Subject: Re: [PATCH net-next v5 2/2] bridge: vlan: signal if anything changed
 on vlan add

On 2017/10/26 22:41, Nikolay Aleksandrov wrote:
> Before this patch there was no way to tell if the vlan add operation
> actually changed anything, thus we would always generate a notification
> on adds. Let's make the notifications more precise and generate them
> only if anything changed, so use the new bool parameter to signal that the
> vlan was updated. We cannot return an error because there are valid use
> cases that will be broken (e.g. overlapping range add) and also we can't
> risk masking errors due to calls into drivers for vlan add which can
> potentially return anything.
> 
> Signed-off-by: Nikolay Aleksandrov <nikolay@...ulusnetworks.com>

Thanks for the explanation in the previous mail.

> ---
...
> @@ -576,8 +592,11 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags)
>  			refcount_inc(&vlan->refcnt);
>  			vlan->flags |= BRIDGE_VLAN_INFO_BRENTRY;
>  			vg->num_vlans++;
> +			*changed = true;
>  		}
> -		__vlan_add_flags(vlan, flags);
> +		if (__vlan_add_flags(vlan, flags))
> +			*changed = true;
> +
>  		return 0;
>  	}
>  
> @@ -601,6 +620,7 @@ int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags)
>  		free_percpu(vlan->stats);
>  		kfree(vlan);

We should not set changed=true in this failure case?

>  	}
> +	*changed = true;
>  
>  	return ret;
>  }
...
> @@ -1050,6 +1083,7 @@ int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags)
>  	ret = __vlan_add(vlan, flags);
>  	if (ret)
>  		kfree(vlan);

Likewise.

> +	*changed = true;
>  
>  	return ret;
>  }
> 

-- 
Toshiaki Makita

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ