Patch "wifi: iwlwifi: mvm: avoid baid size integer overflow" has been added to the 5.4-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: iwlwifi: mvm: avoid baid size integer overflow

to the 5.4-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-iwlwifi-mvm-avoid-baid-size-integer-overflow.patch
and it can be found in the queue-5.4 subdirectory.

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



commit d9c11a2569b0a90e134d2e38e12c135e5abd3856
Author: Johannes Berg <johannes.berg@xxxxxxxxx>
Date:   Tue Jun 20 13:04:02 2023 +0300

    wifi: iwlwifi: mvm: avoid baid size integer overflow
    
    [ Upstream commit 1a528ab1da324d078ec60283c34c17848580df24 ]
    
    Roee reported various hard-to-debug crashes with pings in
    EHT aggregation scenarios. Enabling KASAN showed that we
    access the BAID allocation out of bounds, and looking at
    the code a bit shows that since the reorder buffer entry
    (struct iwl_mvm_reorder_buf_entry) is 128 bytes if debug
    such as lockdep is enabled, then staring from an agg size
    512 we overflow the size calculation, and allocate a much
    smaller structure than we should, causing slab corruption
    once we initialize this.
    
    Fix this by simply using u32 instead of u16.
    
    Reported-by: Roee Goldfiner <roee.h.goldfiner@xxxxxxxxx>
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Gregory Greenman <gregory.greenman@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20230620125813.f428c856030d.I2c2bb808e945adb71bc15f5b2bac2d8957ea90eb@changeid
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index a3255100e3fee..7befb92b5159c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -2557,7 +2557,7 @@ int iwl_mvm_sta_rx_agg(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 	}
 
 	if (iwl_mvm_has_new_rx_api(mvm) && start) {
-		u16 reorder_buf_size = buf_size * sizeof(baid_data->entries[0]);
+		u32 reorder_buf_size = buf_size * sizeof(baid_data->entries[0]);
 
 		/* sparse doesn't like the __align() so don't check */
 #ifndef __CHECKER__



[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