]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath11k: fix NULL dereference in ath11k_qmi_m3_load()
authorMatvey Kovalev <matvey.kovalev@ispras.ru>
Wed, 17 Sep 2025 19:20:01 +0000 (22:20 +0300)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 18 Sep 2025 23:43:48 +0000 (16:43 -0700)
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: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250917192020.1340-1-matvey.kovalev@ispras.ru
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath11k/qmi.c

index 2b547b26ed20aafe3797770a970cca3115c806f3..aea56c38bf8f38982532fc90de25582c26ba4393 100644 (file)
@@ -2548,7 +2548,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;
        }