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: <f47c15da-f574-46ef-9ed5-e5c26658b116@blackwall.org>
Date: Fri, 5 Sep 2025 14:23:40 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Petr Machata <petrm@...dia.com>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Cc: Simon Horman <horms@...nel.org>, Andrew Lunn <andrew@...n.ch>,
 Ido Schimmel <idosch@...dia.com>, bridge@...ts.linux.dev, mlxsw@...dia.com
Subject: Re: [PATCH net] net: bridge: Bounce invalid boolopts

On 9/5/25 14:12, Petr Machata wrote:
> The bridge driver currently tolerates options that it does not recognize.
> Instead, it should bounce them.
> 
> Fixes: a428afe82f98 ("net: bridge: add support for user-controlled bool options")
> Signed-off-by: Petr Machata <petrm@...dia.com>
> Reviewed-by: Ido Schimmel <idosch@...dia.com>
> ---
>   net/bridge/br.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/net/bridge/br.c b/net/bridge/br.c
> index 4bfaf543835a..512872a2ef81 100644
> --- a/net/bridge/br.c
> +++ b/net/bridge/br.c
> @@ -346,6 +346,13 @@ int br_boolopt_multi_toggle(struct net_bridge *br,
>   	int err = 0;
>   	int opt_id;
>   
> +	opt_id = find_next_bit(&bitmap, BITS_PER_LONG, BR_BOOLOPT_MAX);
> +	if (opt_id != BITS_PER_LONG) {
> +		NL_SET_ERR_MSG_FMT_MOD(extack, "Unknown boolean option %d",
> +				       opt_id);
> +		return -EINVAL;
> +	}
> +
>   	for_each_set_bit(opt_id, &bitmap, BR_BOOLOPT_MAX) {
>   		bool on = !!(bm->optval & BIT(opt_id));
>   

IIRC at the time we did this was on purpose, the mask that is returned should
show which options were actually set without disrupting the call.

Anyway I'm ok with returning an error for such options as well, thanks!

Acked-by: Nikolay Aleksandrov <razor@...ckwall.org>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ