linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Alagu Sankar <alagusankar@silex-india.com>,
	Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Brian Norris <briannorris@chromium.org>,
	Wen Gong <wgong@codeaurora.org>,
	Tamizh Chelvam <tamizhr@codeaurora.org>,
	Carl Huang <cjhuang@codeaurora.org>,
	Miaoqing Pan <miaoqing@codeaurora.org>,
	Ben Greear <greearb@candelatech.com>,
	Erik Stromdahl <erik.stromdahl@gmail.com>,
	Fabio Estevam <festevam@denx.de>,
	ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ath10k: fix invalid dma_addr_t token assignment
Date: Mon, 25 Oct 2021 13:04:19 +0000 (UTC)	[thread overview]
Message-ID: <163516705229.3976.16508438608512725859.kvalo@codeaurora.org> (raw)
In-Reply-To: <20211014075153.3655910-1-arnd@kernel.org>

Arnd Bergmann <arnd@kernel.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@arndb.de>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.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


      parent reply	other threads:[~2021-10-25 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14  7:51 [PATCH] ath10k: fix invalid dma_addr_t token assignment Arnd Bergmann
2021-10-18 13:10 ` Kalle Valo
2021-10-25 12:16 ` Fabio Estevam
2021-10-25 13:04 ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=163516705229.3976.16508438608512725859.kvalo@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=alagusankar@silex-india.com \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=ath10k@lists.infradead.org \
    --cc=briannorris@chromium.org \
    --cc=cjhuang@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=erik.stromdahl@gmail.com \
    --cc=festevam@denx.de \
    --cc=greearb@candelatech.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miaoqing@codeaurora.org \
    --cc=netdev@vger.kernel.org \
    --cc=tamizhr@codeaurora.org \
    --cc=wgong@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).