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: <23278f6d-f111-46f7-a844-2cd7fbf8b623@redhat.com>
Date: Thu, 8 May 2025 15:49:27 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Roger Quadros <rogerq@...nel.org>,
 Siddharth Vadapalli <s-vadapalli@...com>, Andrew Lunn
 <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>,
 Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
 Russell King <linux@...linux.org.uk>, danishanwar@...com
Cc: srk@...com, linux-omap@...r.kernel.org, netdev@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v2 7/9] net: ethernet: ti: cpsw_ale: add policer
 save restore for PM sleep

On 5/5/25 6:26 PM, Roger Quadros wrote:
> diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
> index ce216606d915..4e29702b86ea 100644
> --- a/drivers/net/ethernet/ti/cpsw_ale.c
> +++ b/drivers/net/ethernet/ti/cpsw_ale.c
> @@ -1823,3 +1823,45 @@ int cpsw_ale_policer_set_entry(struct cpsw_ale *ale, u32 policer_idx,
>  
>  	return 0;
>  }
> +
> +void cpsw_ale_policer_save(struct cpsw_ale *ale, u32 *data)
> +{
> +	int i, idx;
> +
> +	for (idx = 0; idx < ale->params.num_policers; idx++) {
> +		cpsw_ale_policer_read_idx(ale, idx);
> +
> +		for (i = 0; i < CPSW_ALE_POLICER_ENTRY_WORDS; i++)
> +			data[i] = readl_relaxed(ale->params.ale_regs +
> +						ALE_POLICER_PORT_OUI + 4 * i);
> +
> +		regmap_field_write(ale->fields[ALE_THREAD_CLASS_INDEX], idx);
> +		data[i++] = readl_relaxed(ale->params.ale_regs +
> +					ALE_THREAD_VAL);
> +		data += i * 4;

I'm confused by the '* 4' part. I think that you just need:
		data += i

to move to the next policer context. I *think* the current code causes
OoB?!?

/P


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ