From: Madhavan Ganesan <madhavan.ganesan@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 08/15] wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions for QCN9575
Date: Wed, 18 Nov 2026 10:53:48 +0530 [thread overview]
Message-ID: <c32bcfe7-4258-47b0-9f71-c26bb232c23a@oss.qualcomm.com> (raw)
In-Reply-To: <sashiko-outbox-210876@kernel.org>
On 11/12/2026 2:55 PM, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue to consider:
> - [High] wifi: ath12k: undersized srng_config in
> ath12k_hal_srng_create_config_qcn9575()
> --
>
> commit a0803bb7ba2b3bd95c6970f62088631be5af1b5d
> Author: Madhavan Ganesan <madhavan.ganesan@oss.qualcomm.com>
>
> wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions for QCN9575
>
> This commit adds Wi-Fi 8 HAL operation callbacks, CE descriptor
> definitions, and wires hal_qcn9575_ops into the QCN9575 hardware-version
> map.
>
>> diff --git a/drivers/net/wireless/ath/ath12k/wifi8/hal_qcn9575.c b/drivers/net/wireless/ath/ath12k/wifi8/hal_qcn9575.c
>> index 56d45785ecd44..076a5a609f8b6 100644
>> --- a/drivers/net/wireless/ath/ath12k/wifi8/hal_qcn9575.c
>> +++ b/drivers/net/wireless/ath/ath12k/wifi8/hal_qcn9575.c
>> @@ -2,8 +2,37 @@
>> /*
>> * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
>> */
>> +#include "hal.h"
>> +#include "hal_desc.h"
>> #include "hal_qcn9575.h"
>>
>> +static const struct hal_srng_config hw_srng_config_template[] = {
>> + [HAL_CE_SRC] = {
>> + .start_ring_id = HAL_SRNG_RING_ID_CE0_SRC,
>> + .max_rings = 16,
>> + .entry_size = sizeof(struct hal_ce_srng_src_desc) >> 2,
>> + .mac_type = ATH12K_HAL_SRNG_UMAC,
>> + .ring_dir = HAL_SRNG_DIR_SRC,
>> + .max_size = HAL_CE_SRC_RING_BASE_MSB_RING_SIZE,
>> + },
>> + [HAL_CE_DST] = {
>> + .start_ring_id = HAL_SRNG_RING_ID_CE0_DST,
>> + .max_rings = 16,
>> + .entry_size = sizeof(struct hal_ce_srng_dest_desc) >> 2,
>> + .mac_type = ATH12K_HAL_SRNG_UMAC,
>> + .ring_dir = HAL_SRNG_DIR_SRC,
>> + .max_size = HAL_CE_DST_RING_BASE_MSB_RING_SIZE,
>> + },
>> + [HAL_CE_DST_STATUS] = {
>> + .start_ring_id = HAL_SRNG_RING_ID_CE0_DST_STATUS,
>> + .max_rings = 16,
>> + .entry_size = sizeof(struct hal_ce_srng_dst_status_desc) >> 2,
>> + .mac_type = ATH12K_HAL_SRNG_UMAC,
>> + .ring_dir = HAL_SRNG_DIR_DST,
>> + .max_size = HAL_CE_DST_STATUS_RING_BASE_MSB_RING_SIZE,
>> + },
>> +};
>> +
>> const struct ath12k_hw_regs qcn9575_regs = {
>> /* SW2TCL(x) R0 ring configuration address */
>> .tcl1_ring_id = 0x00001604,
>> @@ -40,3 +69,55 @@ const struct ath12k_hw_regs qcn9575_regs = {
>>
>> .qrtr_node_id = 0x01e03300,
>> };
>> +
>> +static int ath12k_hal_srng_create_config_qcn9575(struct ath12k_hal *hal)
>> +{
>> + struct hal_srng_config *s;
>> +
>> + hal->srng_config = kmemdup(hw_srng_config_template,
>> + sizeof(hw_srng_config_template),
>> + GFP_KERNEL);
>
> [Severity: High]
> Does sizing hw_srng_config_template[] implicitly cause out-of-bounds reads
> on hal->srng_config?
>
> Because the highest designated initializer is [HAL_CE_DST_STATUS] (10),
> hw_srng_config_template[] has only 11 entries, and kmemdup() allocates an
> 11-entry buffer for hal->srng_config. Common HAL code such as
> ath12k_hal_srng_shadow_config() iterates up to HAL_MAX_RING_TYPES (25):
>
> drivers/net/wireless/ath/ath12k/hal.c:ath12k_hal_srng_shadow_config() {
> for (ring_type = 0; ring_type < HAL_MAX_RING_TYPES; ring_type++) {
> struct hal_srng_config *srng_config = &hal->srng_config[ring_type];
> ...
> }
>
> This reads past the end of the kmemdup() allocation for ring types above
> HAL_CE_DST_STATUS. Declaring
> hw_srng_config_template[HAL_MAX_RING_TYPES] would ensure all ring types
> are allocated and zero-initialized.
>
This is a false positive, since the CP/DP changes will complete the table.
next prev parent reply other threads:[~2026-11-18 5:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 8:32 [PATCH ath-next 00/15] wifi: ath12k: add initial Wi-Fi 8 support for QCN9575 Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 01/15] dt-bindings: net: wireless: add ath12k wifi device QCN9575 Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 02/15] wifi: ath12k: refactor PCI window selection to per-device layout Madhavan Ganesan
2026-11-12 8:46 ` sashiko-bot
2026-11-18 5:23 ` Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 03/15] wifi: ath12k: add extended QMI WLAN cfg for CE and service pipes Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 04/15] wifi: ath12k: add QMI support for extended firmware binary download Madhavan Ganesan
2026-11-12 9:07 ` sashiko-bot
2026-11-18 5:23 ` Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 05/15] wifi: ath12k: add Wi-Fi 8 directory and base module scaffolding Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 06/15] wifi: ath12k: add initial Wi-Fi 8 hw params and init helper for QCN9575 Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 07/15] wifi: ath12k: add Wi-Fi 8 HAL register table and hal init hook " Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 08/15] wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions " Madhavan Ganesan
2026-11-12 9:25 ` sashiko-bot
2026-11-18 5:23 ` Madhavan Ganesan [this message]
2026-11-12 8:32 ` [PATCH ath-next 09/15] wifi: ath12k: add unified firmware image support " Madhavan Ganesan
2026-11-12 9:44 ` sashiko-bot
2026-11-18 5:24 ` Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 10/15] wifi: ath12k: add Wi-Fi 8 MHI config " Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 11/15] wifi: ath12k: add Wi-Fi 8 CE config and service pipe map " Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 12/15] wifi: ath12k: add Wi-Fi 8 WMI init " Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 13/15] wifi: ath12k: add Wi-Fi 8 hw ops " Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 14/15] wifi: ath12k: add and hook Wi-Fi 8 mac80211 ops skeleton " Madhavan Ganesan
2026-11-12 10:19 ` sashiko-bot
2026-11-18 5:24 ` Madhavan Ganesan
2026-11-12 8:32 ` [PATCH ath-next 15/15] wifi: ath12k: add Wi-Fi 8 PCI driver scaffolding " Madhavan Ganesan
2026-11-12 10:29 ` sashiko-bot
2026-11-18 5:24 ` Madhavan Ganesan
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=c32bcfe7-4258-47b0-9f71-c26bb232c23a@oss.qualcomm.com \
--to=madhavan.ganesan@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