From: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
To: Jeff Johnson <jeff.johnson@oss.qualcomm.com>, ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH ath-next 3/3] wifi: ath12k: allocate HOST_DDR and BDF regions after Q6 RO region
Date: Tue, 30 Jun 2026 11:00:58 +0530 [thread overview]
Message-ID: <1d307fe7-49df-4616-bfb7-e2050c5ddacd@oss.qualcomm.com> (raw)
In-Reply-To: <2d776c69-51d0-429f-b716-b5302d657047@oss.qualcomm.com>
On 6/30/2026 6:06 AM, Jeff Johnson wrote:
> On 6/10/2026 8:33 PM, Aaradhana Sahu wrote:
>> @@ -2781,9 +2781,12 @@ static int ath12k_qmi_assign_target_mem_chunk(struct ath12k_base *ab)
>> goto out;
>>
>> avail_rmem_size = resource_size(&res);
>> - if (chunk->type == BDF_MEM_REGION_TYPE) {
>> + if (chunk->type == BDF_MEM_REGION_TYPE ||
>> + chunk->type == HOST_DDR_REGION_TYPE) {
>> avail_rmem_size -= ab->hw_params->bdf_addr_offset;
>> - res.start += ab->hw_params->bdf_addr_offset;
>> + avail_rmem_size -= offset;
>> + res.start += ab->hw_params->bdf_addr_offset + offset;
>> + offset += chunk->size;
>
> avail_rmem_size is size_t (unsigned).
> If bdf_addr_offset + offset >= resource_size(&res) (e.g., DT
> misconfiguration), the subtraction silently wraps to a huge value, the
> avail_rmem_size < chunk->size guard passes incorrectly, and ioremap proceeds
> out-of-bounds.
>
> So seems there should be a test to sanitize the DT values.
>
Sure, I will address this in the next version.
>> }
>>
>> if (avail_rmem_size < chunk->size) {
>
next prev parent reply other threads:[~2026-06-30 5:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 3:33 [PATCH ath-next 0/3] wifi: ath12k: Fix memory allocation and improve reserved memory handling Aaradhana Sahu
2026-06-11 3:33 ` [PATCH ath-next 1/3] wifi: ath12k: switch to name-based reserved memory lookup Aaradhana Sahu
2026-06-30 0:30 ` Jeff Johnson
2026-06-30 5:42 ` Aaradhana Sahu
2026-06-11 3:33 ` [PATCH ath-next 2/3] wifi: ath12k: refactor QMI memory assignment Aaradhana Sahu
2026-06-11 3:33 ` [PATCH ath-next 3/3] wifi: ath12k: allocate HOST_DDR and BDF regions after Q6 RO region Aaradhana Sahu
2026-06-30 0:36 ` Jeff Johnson
2026-06-30 5:30 ` Aaradhana Sahu [this message]
2026-06-29 2:15 ` [PATCH ath-next 0/3] wifi: ath12k: Fix memory allocation and improve reserved memory handling Baochen Qiang
2026-06-29 6:30 ` Rameshkumar Sundaram
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=1d307fe7-49df-4616-bfb7-e2050c5ddacd@oss.qualcomm.com \
--to=aaradhana.sahu@oss.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=linux-wireless@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.