Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 9a233bb8 authored by Luca Coelho's avatar Luca Coelho
Browse files

iwlwifi: mvm: check if mac80211_queue is valid in iwl_mvm_disable_txq



Sometimes iwl_mvm_disable_txq() may be called with mac80211_queue ==
IEEE80211_INVAL_HW_QUEUE, and this would cause us to use BIT(0xFF)
which is way too large for the u16 we used to store it in
hw_queue_to_mac820211.  If this happens the following UBSAN warning
will be generated:

[  167.185167] UBSAN: Undefined behaviour in drivers/net/wireless/intel/iwlwifi/mvm/utils.c:838:5
[  167.185171] shift exponent 255 is too large for 64-bit type 'long unsigned int'

Fix that by checking that it is not IEEE80211_INVAL_HW_QUEUE and,
while at it, add a warning if the queue number is larger than
IEEE80211_MAX_QUEUES.

Fixes: 34e10860 ("iwlwifi: mvm: remove references to queue_info in new TX path")
Reported-by: default avatarPaul Menzel <pmenzel+linux-wireless@molgen.mpg.de>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 759931c7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment