Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load()
@ 2025-09-17 19:20 Matvey Kovalev
  2025-09-18  5:25 ` Vasanthakumar Thiagarajan
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Matvey Kovalev @ 2025-09-17 19:20 UTC (permalink / raw)
  To: matvey.kovalev, Jeff Johnson
  Cc: linux-wireless, ath11k, linux-kernel, lvc-project, stable

If ab->fw.m3_data points to data, then fw pointer remains null.
Further, if m3_mem is not allocated, then fw is dereferenced to be
passed to ath11k_err function.

Replace fw->size by m3_len.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 7db88b962f06 ("wifi: ath11k: add firmware-2.bin support")
Cc: stable@vger.kernel.org
Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index 378ac96b861b7..1a42b4abe7168 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2557,7 +2557,7 @@ static int ath11k_qmi_m3_load(struct ath11k_base *ab)
 					   GFP_KERNEL);
 	if (!m3_mem->vaddr) {
 		ath11k_err(ab, "failed to allocate memory for M3 with size %zu\n",
-			   fw->size);
+			   m3_len);
 		ret = -ENOMEM;
 		goto out;
 	}
-- 
2.43.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load()
  2025-09-17 19:20 [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load() Matvey Kovalev
@ 2025-09-18  5:25 ` Vasanthakumar Thiagarajan
  2025-09-18  7:05 ` Baochen Qiang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-09-18  5:25 UTC (permalink / raw)
  To: Matvey Kovalev, Jeff Johnson
  Cc: linux-wireless, ath11k, linux-kernel, lvc-project, stable



On 9/18/2025 12:50 AM, Matvey Kovalev wrote:
> If ab->fw.m3_data points to data, then fw pointer remains null.
> Further, if m3_mem is not allocated, then fw is dereferenced to be
> passed to ath11k_err function.
> 
> Replace fw->size by m3_len.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 7db88b962f06 ("wifi: ath11k: add firmware-2.bin support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru>

Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load()
  2025-09-17 19:20 [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load() Matvey Kovalev
  2025-09-18  5:25 ` Vasanthakumar Thiagarajan
@ 2025-09-18  7:05 ` Baochen Qiang
  2025-09-18 19:35 ` Jeff Johnson
  2025-09-18 23:47 ` Jeff Johnson
  3 siblings, 0 replies; 5+ messages in thread
From: Baochen Qiang @ 2025-09-18  7:05 UTC (permalink / raw)
  To: Matvey Kovalev, Jeff Johnson
  Cc: linux-wireless, ath11k, linux-kernel, lvc-project, stable



On 9/18/2025 3:20 AM, Matvey Kovalev wrote:
> If ab->fw.m3_data points to data, then fw pointer remains null.
> Further, if m3_mem is not allocated, then fw is dereferenced to be
> passed to ath11k_err function.
> 
> Replace fw->size by m3_len.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 7db88b962f06 ("wifi: ath11k: add firmware-2.bin support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru>
> ---
>  drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
> index 378ac96b861b7..1a42b4abe7168 100644
> --- a/drivers/net/wireless/ath/ath11k/qmi.c
> +++ b/drivers/net/wireless/ath/ath11k/qmi.c
> @@ -2557,7 +2557,7 @@ static int ath11k_qmi_m3_load(struct ath11k_base *ab)
>  					   GFP_KERNEL);
>  	if (!m3_mem->vaddr) {
>  		ath11k_err(ab, "failed to allocate memory for M3 with size %zu\n",
> -			   fw->size);
> +			   m3_len);
>  		ret = -ENOMEM;
>  		goto out;
>  	}

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load()
  2025-09-17 19:20 [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load() Matvey Kovalev
  2025-09-18  5:25 ` Vasanthakumar Thiagarajan
  2025-09-18  7:05 ` Baochen Qiang
@ 2025-09-18 19:35 ` Jeff Johnson
  2025-09-18 23:47 ` Jeff Johnson
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2025-09-18 19:35 UTC (permalink / raw)
  To: Matvey Kovalev, Jeff Johnson
  Cc: linux-wireless, ath11k, linux-kernel, lvc-project, stable

On 9/17/2025 12:20 PM, Matvey Kovalev wrote:
> If ab->fw.m3_data points to data, then fw pointer remains null.
> Further, if m3_mem is not allocated, then fw is dereferenced to be
> passed to ath11k_err function.
> 
> Replace fw->size by m3_len.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 7db88b962f06 ("wifi: ath11k: add firmware-2.bin support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Matvey Kovalev <matvey.kovalev@ispras.ru>
> ---
>  drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
> index 378ac96b861b7..1a42b4abe7168 100644
> --- a/drivers/net/wireless/ath/ath11k/qmi.c
> +++ b/drivers/net/wireless/ath/ath11k/qmi.c
> @@ -2557,7 +2557,7 @@ static int ath11k_qmi_m3_load(struct ath11k_base *ab)
>  					   GFP_KERNEL);
>  	if (!m3_mem->vaddr) {
>  		ath11k_err(ab, "failed to allocate memory for M3 with size %zu\n",
> -			   fw->size);
> +			   m3_len);
>  		ret = -ENOMEM;
>  		goto out;
>  	}

I'll fix this subject misspelling:
WARNING:TYPO_SPELLING: 'derefence' may be misspelled - perhaps 'dereference'?

/jeff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load()
  2025-09-17 19:20 [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load() Matvey Kovalev
                   ` (2 preceding siblings ...)
  2025-09-18 19:35 ` Jeff Johnson
@ 2025-09-18 23:47 ` Jeff Johnson
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2025-09-18 23:47 UTC (permalink / raw)
  To: Jeff Johnson, Matvey Kovalev
  Cc: linux-wireless, ath11k, linux-kernel, lvc-project, stable


On Wed, 17 Sep 2025 22:20:01 +0300, Matvey Kovalev wrote:
> If ab->fw.m3_data points to data, then fw pointer remains null.
> Further, if m3_mem is not allocated, then fw is dereferenced to be
> passed to ath11k_err function.
> 
> Replace fw->size by m3_len.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> [...]

Applied, thanks!

[1/1] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load()
      commit: 3fd2ef2ae2b5c955584a3bee8e83ae7d7a98f782

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-09-18 23:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 19:20 [PATCH] wifi: ath11k: fix NULL derefence in ath11k_qmi_m3_load() Matvey Kovalev
2025-09-18  5:25 ` Vasanthakumar Thiagarajan
2025-09-18  7:05 ` Baochen Qiang
2025-09-18 19:35 ` Jeff Johnson
2025-09-18 23:47 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox