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: <06297829-0bf7-4a06-baaf-e32c39888947@lunn.ch>
Date: Fri, 9 Aug 2024 22:25:09 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Tan En De <endeneer@...il.com>
Cc: netdev@...r.kernel.org, alexandre.torgue@...s.st.com,
	joabreu@...opsys.com, davem@...emloft.net, edumazet@...gle.com,
	kuba@...nel.org, pabeni@...hat.com, mcoquelin.stm32@...il.com,
	linux-kernel@...r.kernel.org, leyfoon.tan@...rfivetech.com,
	Tan En De <ende.tan@...rfivetech.com>
Subject: Re: [net,1/1] net: stmmac: Set OWN bit last in dwmac4_set_rx_owner()

On Fri, Aug 09, 2024 at 10:42:29PM +0800, Tan En De wrote:
> Ensure that all other bits in the RDES3 descriptor are configured before
> transferring ownership of the descriptor to DMA via the OWN bit.

Are you seeing things going wrong with real hardware, or is this just
code review? If this is a real problem, please add a description of
what the user would see.

Does this need to be backported in stable?

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html

If it does, you should add a Fixes: tag and 'Cc: stable@...r.kernel.org'

This will also decide which tree you need to base the patch on:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html#netdev-faq

>  static void dwmac4_set_rx_owner(struct dma_desc *p, int disable_rx_ic)
>  {
> -	p->des3 |= cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR);
> +	p->des3 |= cpu_to_le32(RDES3_BUFFER1_VALID_ADDR);
>  
>  	if (!disable_rx_ic)
>  		p->des3 |= cpu_to_le32(RDES3_INT_ON_COMPLETION_EN);
> +
> +	dma_wmb();
> +	p->des3 |= cpu_to_le32(RDES3_OWN);

Is the problem here that RDES3_INT_ON_COMPLETION_EN is added after the
RDES3_OWN above has hit the hardware, so it gets ignored?

It seems like it would be better to calculate the value in a local
variable, and then assign to p->des3 once.

	  Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ