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]
Message-ID: <aPugwiMrKqlDW4c1@horms.kernel.org>
Date: Fri, 24 Oct 2025 16:52:34 +0100
From: Simon Horman <horms@...nel.org>
To: David Yang <mmyangfl@...il.com>
Cc: netdev@...r.kernel.org, Andrew Lunn <andrew@...n.ch>,
	Vladimir Oltean <olteanv@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Russell King <linux@...linux.org.uk>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/3] net: dsa: yt921x: Add STP/MST support

On Fri, Oct 24, 2025 at 11:32:27AM +0800, David Yang wrote:

...

> +static int
> +yt921x_dsa_vlan_msti_set(struct dsa_switch *ds, struct dsa_bridge bridge,
> +			 const struct switchdev_vlan_msti *msti)
> +{
> +	struct yt921x_priv *priv = to_yt921x_priv(ds);
> +	u64 mask64;
> +	u64 ctrl64;
> +	int res;
> +
> +	if (!msti->vid)
> +		return -EINVAL;
> +	if (msti->msti <= 0 || msti->msti >= YT921X_MSTI_NUM)
> +		return -EINVAL;
> +
> +	mask64 = YT921X_VLAN_CTRL_STP_ID_M;

Hi David,

YT921X_VLAN_CTRL_STP_ID_M is defined as follows in yt931x.h

#define  YT921X_VLAN_CTRL_STP_ID_M              GENMASK(39, 36)

This creates an unsigned long mask. However, on 32bit systems,
unsigned long is only 32 bits wide. So this will result in
a build error on such systems.

In order to avoid this I think the declaration of YT921X_VLAN_CTRL_STP_ID_M
should be updated to use GENMASK_ULL. This is also likely true
for other, as yet unused, #defines in yt931x.h.


> +	ctrl64 = YT921X_VLAN_CTRL_STP_ID(msti->msti);
> +
> +	mutex_lock(&priv->reg_lock);
> +	res = yt921x_reg64_update_bits(priv, YT921X_VLANn_CTRL(msti->vid),
> +				       mask64, ctrl64);
> +	mutex_unlock(&priv->reg_lock);
> +
> +	return res;
> +}

...

-- 
pw-bot: changes-requested

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ