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: <20250331165137.467fbea1@kernel.org>
Date: Mon, 31 Mar 2025 16:51:37 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Tobias Waldekranz <tobias@...dekranz.com>
Cc: davem@...emloft.net, maxime.chevallier@...tlin.com,
 marcin.s.wojtas@...il.com, linux@...linux.org.uk, andrew@...n.ch,
 edumazet@...gle.com, pabeni@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH v4 net] net: mvpp2: Prevent parser TCAM memory
 corruption

On Thu, 27 Mar 2025 11:30:49 +0100 Tobias Waldekranz wrote:
> +static void mvpp2_prs_mac_promisc_set_unlocked(struct mvpp2 *priv, int port,

Could be subjective but I tend to call things _locked, not _unlocked.
As it the function is called in context in which the state is already
locked. Could you change? Another way would be to just prepend two
underscores to the name..

> +					       enum mvpp2_prs_l2_cast l2_cast,
> +					       bool add)
>  {
>  	struct mvpp2_prs_entry pe;
>  	unsigned char cast_match;
>  	unsigned int ri;
>  	int tid;
>  
> +	lockdep_assert_held(&priv->prs_spinlock);
> +
>  	if (l2_cast == MVPP2_PRS_L2_UNI_CAST) {
>  		cast_match = MVPP2_PRS_UCAST_VAL;
>  		tid = MVPP2_PE_MAC_UC_PROMISCUOUS;

> @@ -522,6 +541,14 @@ void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port,
>  	mvpp2_prs_hw_write(priv, &pe);
>  }
>  
> +void mvpp2_prs_mac_promisc_set(struct mvpp2 *priv, int port,
> +			       enum mvpp2_prs_l2_cast l2_cast, bool add)
> +{
> +		spin_lock_bh(&priv->prs_spinlock);
> +		mvpp2_prs_mac_promisc_set_unlocked(priv, port, l2_cast, add);
> +		spin_unlock_bh(&priv->prs_spinlock);

nit2: this is indented too much

> +}
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ