mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
qcacld-3.0: Prevent overread of UP to AC mapping table
Currently the User Priority (UP) returned by hdd_wmm_classify_pkt() is used without any checks by hdd_get_queue_index() to lookup the Access Category (AC) in the mapping table hdd_linux_up_to_ac_map[]. Although the UP returned by hdd_wmm_classify_pkt() should be within the valid range, for safety add an explicit check to prevent an overread of the table. Change-Id: Iacd8d97bcc7a3939cdb2469f6830adc2ffc24765 CRs-Fixed: 1041989
This commit is contained in:
parent
74da41bcc2
commit
e54e2ae247
1 changed files with 15 additions and 3 deletions
|
|
@ -1643,6 +1643,19 @@ void hdd_wmm_classify_pkt(hdd_adapter_t *adapter,
|
|||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* __hdd_get_queue_index() - get queue index
|
||||
* @up: user priority
|
||||
*
|
||||
* Return: queue_index
|
||||
*/
|
||||
static uint16_t __hdd_get_queue_index(uint16_t up)
|
||||
{
|
||||
if (qdf_unlikely(up >= ARRAY_SIZE(hdd_linux_up_to_ac_map)))
|
||||
return HDD_LINUX_AC_BE;
|
||||
return hdd_linux_up_to_ac_map[up];
|
||||
}
|
||||
|
||||
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
||||
/**
|
||||
* hdd_get_queue_index() - get queue index
|
||||
|
|
@ -1656,14 +1669,13 @@ uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol)
|
|||
{
|
||||
if (qdf_unlikely(is_eapol == true))
|
||||
return HDD_LINUX_AC_HI_PRIO;
|
||||
else
|
||||
return hdd_linux_up_to_ac_map[up];
|
||||
return __hdd_get_queue_index(up);
|
||||
}
|
||||
#else
|
||||
static
|
||||
uint16_t hdd_get_queue_index(uint16_t up, bool is_eapol)
|
||||
{
|
||||
return hdd_linux_up_to_ac_map[up];
|
||||
return __hdd_get_queue_index(up);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue