From: Kalle Valo <kvalo@kernel.org>
To: Benjamin Berg <benjamin@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, benjamin.berg@intel.com,
miriam.rachel.korenblit@intel.com, regressions@lists.linux.dev,
johannes@sipsolutions.net,
Chris Bainbridge <chris.bainbridge@gmail.com>,
Ben Greear <greearb@candelatech.com>
Subject: Re: [PATCH v2] wifi: iwlwifi: correctly lookup DMA address in SG table
Date: Mon, 12 Aug 2024 14:27:24 +0300 [thread overview]
Message-ID: <87ttfq0yn7.fsf@kernel.org> (raw)
In-Reply-To: <20240812110640.460514-1-benjamin@sipsolutions.net> (Benjamin Berg's message of "Mon, 12 Aug 2024 13:06:40 +0200")
Benjamin Berg <benjamin@sipsolutions.net> writes:
> From: Benjamin Berg <benjamin.berg@intel.com>
>
> The code to lookup the scatter gather table entry assumed that it was
> possible to use sg_virt() in order to lookup the DMA address in a mapped
> scatter gather table. However, this assumption is incorrect as the DMA
> mapping code may merge multiple entries into one. In that case, the DMA
> address space may have e.g. two consecutive pages which is correctly
> represented by the scatter gather list entry, however the virtual
> addresses for these two pages may differ and the relationship cannot be
> resolved anymore.
>
> Avoid this problem entirely by working with the offset into the mapped
> area instead of using virtual addresses. With that we only use the DMA
> length and DMA address from the scatter gather list entries. The
> underlying DMA/IOMMU code is therefore free to merge two entries into
> one even if the virtual addresses space for the area is not continuous.
>
> Fixes: 90db50755228 ("wifi: iwlwifi: use already mapped data when TXing an AMSDU")
> Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com>
> Closes: https://lore.kernel.org/r/ZrNRoEbdkxkKFMBi@debian.local
> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
>
> ---
>
> We also verified the (previous) patch internally and it is working well
> there now.
>
> v2: Add proper bounds checking by verifying the length
Excellent, thank you Benjamin for working on this. Miri, can I have your
ack? I would like to apply this tomorrow so that it makes it still this
week's wireless pull request.
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2024-08-12 11:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-12 11:06 [PATCH v2] wifi: iwlwifi: correctly lookup DMA address in SG table Benjamin Berg
2024-08-12 11:27 ` Kalle Valo [this message]
2024-08-12 12:20 ` Chris Bainbridge
2024-08-13 9:50 ` Kalle Valo
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=87ttfq0yn7.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=benjamin.berg@intel.com \
--cc=benjamin@sipsolutions.net \
--cc=chris.bainbridge@gmail.com \
--cc=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
--cc=regressions@lists.linux.dev \
/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