Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Madhavan Ganesan" <madhavan.ganesan@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH ath-next v3 08/15] wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions for QCN9575
Date: Wed, 18 Nov 2026 08:33:06 +0000	[thread overview]
Message-ID: <sashiko-outbox-220456@kernel.org> (raw)
In-Reply-To: <20261118-wifi8_qcn9575_bringup-v3-8-9875d2a3953f@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] wifi: ath12k: undersized hw_srng_config_template in
  hal_qcn9575.c
--

commit c90add26721221071c7aba069630ff7548f8ea25
Author: Madhavan Ganesan <madhavan.ganesan@oss.qualcomm.com>

wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions for QCN9575

This commit implements Wi-Fi 8 HAL operations, CE descriptor layouts, and
SRNG configuration for QCN9575.

> 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 = {

[ ... ]

> @@ -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]
Should hw_srng_config_template be sized to HAL_MAX_RING_TYPES?

Because hw_srng_config_template[] has no explicit array bound and its last
initializer is [HAL_CE_DST_STATUS] (10), kmemdup() allocates only 11
entries for hal->srng_config instead of HAL_MAX_RING_TYPES (25).  Callers
such as ath12k_hal_srng_shadow_config() and ath12k_hal_srng_get_entrysize()
index hal->srng_config up to HAL_MAX_RING_TYPES - 1, causing an
out-of-bounds slab read for any ring type above HAL_CE_DST_STATUS.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118-wifi8_qcn9575_bringup-v3-0-9875d2a3953f@oss.qualcomm.com?part=8

  reply	other threads:[~2026-11-18  8:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18  8:15 [PATCH ath-next v3 00/15] wifi: ath12k: add initial Wi-Fi 8 support for QCN9575 Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 01/15] dt-bindings: net: wireless: add ath12k wifi device QCN9575 Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 02/15] wifi: ath12k: refactor PCI window selection to per-device layout Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 03/15] wifi: ath12k: add extended QMI WLAN cfg for CE and service pipes Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 04/15] wifi: ath12k: add QMI support for extended firmware binary download Madhavan Ganesan
2026-11-18  8:35   ` sashiko-bot
2026-11-18  8:15 ` [PATCH ath-next v3 05/15] wifi: ath12k: add Wi-Fi 8 directory and base module scaffolding Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 06/15] wifi: ath12k: add initial Wi-Fi 8 hw params and init helper for QCN9575 Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 07/15] wifi: ath12k: add Wi-Fi 8 HAL register table and hal init hook " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 08/15] wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions " Madhavan Ganesan
2026-11-18  8:33   ` sashiko-bot [this message]
2026-11-18  8:15 ` [PATCH ath-next v3 09/15] wifi: ath12k: add unified firmware image support " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 10/15] wifi: ath12k: add Wi-Fi 8 MHI config " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 11/15] wifi: ath12k: add Wi-Fi 8 CE config and service pipe map " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 12/15] wifi: ath12k: add Wi-Fi 8 WMI init " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 13/15] wifi: ath12k: add Wi-Fi 8 hw ops " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 14/15] wifi: ath12k: add and hook Wi-Fi 8 mac80211 ops skeleton " Madhavan Ganesan
2026-11-18  8:15 ` [PATCH ath-next v3 15/15] wifi: ath12k: add Wi-Fi 8 PCI driver scaffolding " Madhavan Ganesan
2026-11-18  8:31   ` sashiko-bot

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=sashiko-outbox-220456@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=madhavan.ganesan@oss.qualcomm.com \
    --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