[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <163516705229.3976.16508438608512725859.kvalo@codeaurora.org>
Date: Mon, 25 Oct 2021 13:04:19 +0000 (UTC)
From: Kalle Valo <kvalo@...eaurora.org>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Alagu Sankar <alagusankar@...ex-india.com>,
Arnd Bergmann <arnd@...db.de>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Brian Norris <briannorris@...omium.org>,
Wen Gong <wgong@...eaurora.org>,
Tamizh Chelvam <tamizhr@...eaurora.org>,
Carl Huang <cjhuang@...eaurora.org>,
Miaoqing Pan <miaoqing@...eaurora.org>,
Ben Greear <greearb@...delatech.com>,
Erik Stromdahl <erik.stromdahl@...il.com>,
Fabio Estevam <festevam@...x.de>, ath10k@...ts.infradead.org,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ath10k: fix invalid dma_addr_t token assignment
Arnd Bergmann <arnd@...nel.org> wrote:
> Using a kernel pointer in place of a dma_addr_t token can
> lead to undefined behavior if that makes it into cache
> management functions. The compiler caught one such attempt
> in a cast:
>
> drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_add_interface':
> drivers/net/wireless/ath/ath10k/mac.c:5586:47: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> 5586 | arvif->beacon_paddr = (dma_addr_t)arvif->beacon_buf;
> | ^
>
> Looking through how this gets used down the way, I'm fairly
> sure that beacon_paddr is never accessed again for ATH10K_DEV_TYPE_HL
> devices, and if it was accessed, that would be a bug.
>
> Change the assignment to use a known-invalid address token
> instead, which avoids the warning and makes it easier to catch
> bugs if it does end up getting used.
>
> Fixes: e263bdab9c0e ("ath10k: high latency fixes for beacon buffer")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Kalle Valo <kvalo@...eaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
937e79c67740 ath10k: fix invalid dma_addr_t token assignment
--
https://patchwork.kernel.org/project/linux-wireless/patch/20211014075153.3655910-1-arnd@kernel.org/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Powered by blists - more mailing lists