Patch "wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()" 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: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()

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-cfg80211-tests-fix-potential-null-dereference-i.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 7860b7d40a5d9327a368c4ce6ba678336279cbbc
Author: Zichen Xie <zichenxie0106@xxxxxxxxx>
Date:   Fri Nov 15 00:38:36 2024 -0600

    wifi: cfg80211: tests: Fix potential NULL dereference in test_cfg80211_parse_colocated_ap()
    
    [ Upstream commit 13c4f7714c6a1ecf748a2f22099447c14fe6ed8c ]
    
    kunit_kzalloc() may return NULL, dereferencing it without NULL check may
    lead to NULL dereference.
    Add a NULL check for ies.
    
    Fixes: 45d43937a44c ("wifi: cfg80211: add a kunit test for 6 GHz colocated AP parsing")
    Signed-off-by: Zichen Xie <zichenxie0106@xxxxxxxxx>
    Link: https://patch.msgid.link/20241115063835.5888-1-zichenxie0106@xxxxxxxxx
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/wireless/tests/scan.c b/net/wireless/tests/scan.c
index 9f458be716595..79a99cf5e8922 100644
--- a/net/wireless/tests/scan.c
+++ b/net/wireless/tests/scan.c
@@ -810,6 +810,8 @@ static void test_cfg80211_parse_colocated_ap(struct kunit *test)
 		skb_put_data(input, "123", 3);
 
 	ies = kunit_kzalloc(test, struct_size(ies, data, input->len), GFP_KERNEL);
+	KUNIT_ASSERT_NOT_NULL(test, ies);
+
 	ies->len = input->len;
 	memcpy(ies->data, input->data, input->len);
 




[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