mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-10 12:52:37 -05:00
qcacld-3.0: Check on IE length to avoid buffer over-read
An incorrect IE length can overflow the remaining length variable and make IE parsing logic perform a buffer over-read. Check on IE length to avoid buffer over-read. Change-Id: I20ef6a0136c7a5b602ad15a2fb725f20807b81d0 CRs-Fixed: 2052804
This commit is contained in:
parent
2f6509fce7
commit
4bea8b4d2b
1 changed files with 8 additions and 0 deletions
|
|
@ -14450,6 +14450,14 @@ static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie,
|
|||
eLen = *genie++;
|
||||
remLen -= 2;
|
||||
|
||||
/* Sanity check on eLen */
|
||||
if (eLen > remLen) {
|
||||
hdd_err("%s: Invalid IE length[%d] for IE[0x%X]",
|
||||
__func__, eLen, elementId);
|
||||
QDF_ASSERT(0);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_debug("IE[0x%X], LEN[%d]", elementId, eLen);
|
||||
|
||||
switch (elementId) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue