qcacmn: Access wlan_crypto_cipher structure if key->valid flag is set
Access wlan_crypto_cipher structure if the key and cipher_table's are valid. Also, added changes to avoid dangling pointer accessing after deleting key. Change-Id: Ia9a5942c9597f03eb1707d149797f33760eeac21
This commit is contained in:

committed by
Madan Koyyalamudi

부모
7aa318326f
커밋
4bdf46d8ed
@@ -1427,6 +1427,7 @@ QDF_STATUS wlan_crypto_delkey(struct wlan_objmgr_vdev *vdev,
|
||||
/* Zero-out local key variables */
|
||||
qdf_mem_zero(key, sizeof(struct wlan_crypto_key));
|
||||
qdf_mem_free(key);
|
||||
key = NULL;
|
||||
|
||||
ret_rel_ref:
|
||||
if (peer)
|
||||
@@ -1765,6 +1766,12 @@ QDF_STATUS wlan_crypto_decap(struct wlan_objmgr_vdev *vdev,
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (!key->valid || !key->cipher_table) {
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* if tkip, is counter measures enabled, then drop the frame */
|
||||
cipher_table = (struct wlan_crypto_cipher *)key->cipher_table;
|
||||
status = cipher_table->decap(key, wbuf, tid, hdrlen);
|
||||
|
Reference in New Issue
Block a user