Patch "wifi: wcn36xx: fix channel survey memory allocation size" has been added to the 6.12-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: wcn36xx: fix channel survey memory allocation size

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-wcn36xx-fix-channel-survey-memory-allocation-si.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9f0b7439798543c924feb56c754806d5d902e20a
Author: Barnabás Czémán <barnabas.czeman@xxxxxxxxxxxxxx>
Date:   Mon Nov 4 21:00:35 2024 +0100

    wifi: wcn36xx: fix channel survey memory allocation size
    
    [ Upstream commit 6200d947f050efdba4090dfefd8a01981363d954 ]
    
    KASAN reported a memory allocation issue in wcn->chan_survey
    due to incorrect size calculation.
    This commit uses kcalloc to allocate memory for wcn->chan_survey,
    ensuring proper initialization and preventing the use of uninitialized
    values when there are no frames on the channel.
    
    Fixes: 29696e0aa413 ("wcn36xx: Track SNR and RSSI for each RX frame")
    Signed-off-by: Barnabás Czémán <barnabas.czeman@xxxxxxxxxxxxxx>
    Acked-by: Loic Poulain <loic.poulain@xxxxxxxxxx>
    Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
    Link: https://patch.msgid.link/20241104-wcn36xx-memory-allocation-v1-1-5ec901cf37b6@xxxxxxxxxxxxxx
    Signed-off-by: Jeff Johnson <quic_jjohnson@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index 408776562a7e5..cd36cab6db75d 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -1590,7 +1590,10 @@ static int wcn36xx_probe(struct platform_device *pdev)
 	}
 
 	n_channels = wcn_band_2ghz.n_channels + wcn_band_5ghz.n_channels;
-	wcn->chan_survey = devm_kmalloc(wcn->dev, n_channels, GFP_KERNEL);
+	wcn->chan_survey = devm_kcalloc(wcn->dev,
+					n_channels,
+					sizeof(struct wcn36xx_chan_survey),
+					GFP_KERNEL);
 	if (!wcn->chan_survey) {
 		ret = -ENOMEM;
 		goto out_wq;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux