From: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
To: sashiko-reviews@lists.linux.dev
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH ath-next v2 13/17] wifi: ath12k: use CMEM write for PPT on hybrid bus devices
Date: Wed, 21 Oct 2026 15:31:57 +0530 [thread overview]
Message-ID: <02c95465-fca7-4324-bb9a-5bc2b34049b3@oss.qualcomm.com> (raw)
In-Reply-To: <sashiko-outbox-173688@kernel.org>
On 10/16/2026 9:11 AM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] wifi: ath12k: OOB array read in ath12k_dp_cmem_init() due to mixed MLO mem modes
> --
>
> commit b4813e2e272b2801865377c6c50ae123db10e5d7
> Author: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
>
> wifi: ath12k: use CMEM write for PPT on hybrid bus devices
>
> This commit updates the Primary Page Table (PPT) initialization to use
> CMEM-specific write operations on hybrid bus devices. It also propagates
> errors from these CMEM writes during PPT and partner copy cache
> initialization, aborting MLO setup if a failure occurs.
>
>> diff --git a/drivers/net/wireless/ath/ath12k/dp.c b/drivers/net/wireless/ath/ath12k/dp.c
>> index 83f9edfabf696..6cf254b2d2a78 100644
>> --- a/drivers/net/wireless/ath/ath12k/dp.c
>> +++ b/drivers/net/wireless/ath/ath12k/dp.c
> [ ... ]
>> @@ -1328,24 +1328,38 @@ static int ath12k_dp_cmem_init(struct ath12k_base *ab,
>> }
>>
>> /* Write to PPT in CMEM */
>> - for (i = start; i < end; i++)
>> - ath12k_hif_write32(ab, cmem_base + ATH12K_PPT_ADDR_OFFSET(i),
>> - dp->spt_info[i].paddr >> ATH12K_SPT_4K_ALIGN_OFFSET);
>> + for (i = start; i < end; i++) {
>> + addr = cmem_base + ATH12K_PPT_ADDR_OFFSET(i);
>> + val = dp->spt_info[i].paddr >> ATH12K_SPT_4K_ALIGN_OFFSET;
>
> [Severity: High]
> Can this result in an out-of-bounds array read on hybrid bus MLO devices?
>
> The loop limits start and end are derived from the current device's
> profile (ab->profile_param->dp_params). However, the array being indexed,
> dp->spt_info[i], belongs to the partner device.
>
> On systems with mixed-bus MLO configurations (like an AHB radio and a PCI
> radio in the same MLO group) and constrained memory, the devices might have
> different memory profiles. For example, if the AHB device has the DEFAULT
> profile but the PCI partner is using the LOW_512_M profile, the AHB device
> will calculate a larger end value than the size of the partner's allocated
> spt_info array.
>
> Does this mean the loop will read past the end of the spt_info array and
> write garbage memory values to the device's CMEM Primary Page Table?
>
This is not expected to happen, as all devices in the same MLO group are expected
to operate with the same memory profile. The profile (DEFAULT or LOW_512_M) is
selected based on the platform's RAM size, so all devices on the platform are
expected to use the same profile.
>> +
>> + if (ab->hw_params->hybrid_bus_type) {
>> + ret = ath12k_hif_cmem_write32(ab, addr, val);
>> + if (ret)
>> + return ret;
>> + } else {
>> + ath12k_hif_write32(ab, addr, val);
>> + }
>> + }
>>
>> return 0;
>> }
>
next prev parent reply other threads:[~2026-10-21 10:02 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 3:21 [PATCH ath-next v2 00/17] wifi: ath12k: Add support for QCN6432 Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 01/17] dt-bindings: net: wireless: Add QCN6432 device tree binding documentation Aaradhana Sahu
2026-10-17 17:00 ` Krzysztof Kozlowski
2026-10-21 5:27 ` Aaradhana Sahu
2026-10-17 17:01 ` Krzysztof Kozlowski
2026-10-21 5:27 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 02/17] wifi: ath12k: Refactor PCI operations and MSI config structure Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 03/17] wifi: ath12k: Add hardware parameter for QCN6432 Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-21 6:40 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 04/17] wifi: ath12k: Add hardware ring mask " Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 05/17] wifi: ath12k: add hardware registers " Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 06/17] wifi: ath12k: move multi MSI vector flag to ath12k_dev_flags Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 07/17] wifi: ath12k: Add hybrid_bus_type in ath12k_hw_params Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 08/17] wifi: ath12k: Add hif operation support for QCN6432 Aaradhana Sahu
2026-10-16 3:46 ` sashiko-bot
2026-10-21 10:09 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 09/17] wifi: ath12k: add support for unified data-region memory allocation Aaradhana Sahu
2026-10-16 3:35 ` sashiko-bot
2026-10-21 10:15 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 10/17] wifi: ath12k: move MSI config to pci.c Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 11/17] wifi: ath12k: Add platform MSI support for CE Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 12/17] wifi: ath12k: Enable MSI interrupt support for DP interrupt Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-21 10:44 ` Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 13/17] wifi: ath12k: use CMEM write for PPT on hybrid bus devices Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-21 10:01 ` Aaradhana Sahu [this message]
2026-10-16 3:21 ` [PATCH ath-next v2 14/17] wifi: ath12k: store and use MSI data per CE and DP interrupt group for QCN6432 Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 15/17] wifi: ath12k: Derive QMI service instance ID per protection domain Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 16/17] wifi: ath12k: Resolve userPD ID per device Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 17/17] wifi: ath12k: Add QCN6432 AHB support Aaradhana Sahu
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=02c95465-fca7-4324-bb9a-5bc2b34049b3@oss.qualcomm.com \
--to=aaradhana.sahu@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@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