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: <aRxF6S72ffPclf6n@FUE-ALEWI-WINX>
Date: Tue, 18 Nov 2025 11:09:45 +0100
From: Alexander Wilhelm <alexander.wilhelm@...termo.com>
To: Baochen Qiang <baochen.qiang@....qualcomm.com>
Cc: Jeff Johnson <jjohnson@...nel.org>, linux-wireless@...r.kernel.org,
        ath12k@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] wifi: ath12k: fix endianness handling for SRNG ring
 pointer accesses

On Tue, Nov 18, 2025 at 05:53:52PM +0800, Baochen Qiang wrote:
> 
> 
> On 11/18/2025 5:46 PM, Alexander Wilhelm wrote:
> > On Tue, Nov 18, 2025 at 05:35:09PM +0800, Baochen Qiang wrote:
> >>
> >>
> >> On 11/18/2025 3:21 PM, Alexander Wilhelm wrote:
> >>> The SRNG head and tail ring pointers are stored in device memory as
> >>> little-endian values. On big-endian systems, direct dereferencing of these
> >>> pointers leads to incorrect values being read or written, causing ring
> >>> management issues and potentially breaking data flow.
> >>>
> >>> This patch ensures all accesses to SRNG ring pointers use the appropriate
> >>> endianness conversions. This affects both read and write paths for source
> >>> and destination rings, as well as debug output. The changes guarantee
> >>> correct operation on both little- and big-endian architectures.
> >>>
> >>> Signed-off-by: Alexander Wilhelm <alexander.wilhelm@...termo.com>
> >>> ---
> >>>  drivers/net/wireless/ath/ath12k/hal.c | 35 +++++++++++++++------------
> >>>  1 file changed, 20 insertions(+), 15 deletions(-)
> >>>
> >>> diff --git a/drivers/net/wireless/ath/ath12k/hal.c b/drivers/net/wireless/ath/ath12k/hal.c
> >>> index 6406fcf5d69f..bd4d1de9eb1a 100644
> >>> --- a/drivers/net/wireless/ath/ath12k/hal.c
> >>> +++ b/drivers/net/wireless/ath/ath12k/hal.c
> >>> @@ -2007,7 +2007,7 @@ int ath12k_hal_srng_dst_num_free(struct ath12k_base *ab, struct hal_srng *srng,
> >>>  	tp = srng->u.dst_ring.tp;
> >>>  
> >>>  	if (sync_hw_ptr) {
> >>> -		hp = *srng->u.dst_ring.hp_addr;
> >>> +		hp = le32_to_cpu(*srng->u.dst_ring.hp_addr);
> >>
> >> should we also need to change its type to '__le32 *'?
> > 
> > I saw that in the 'wifi: ath12k: fix endianness handling while accessing wmi
> > service bit' patch where '__le32' was used? Which one should I preferably use?
> 
> I mean, should hp_addr in hal_srng structure be declared as '__le32 *' ?

Oh, you're right. I'll do that in v2. I'll set '__le32 *' for 'hp_addr/tp_addr'
for both 'dst_ring' and 'src_ring'. Thank you for the found issue.


Best regards
Alexander Wilhelm

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ