qcacld-3.0: Validate kek_len in wlan_hdd_save_gtk_offload_params

Although the kek_len should have already been validated before the
function is called, update wlan_hdd_save_gtk_offload_params() to limit
kek_len to the maximum allowed value before using it to copy the kek.

Change-Id: I0676521171343c6fe58afcdc31477f555598c490
CRs-Fixed: 2140033
This commit is contained in:
Jeff Johnson 2017-11-14 14:42:55 -08:00 • committed by snandini
commit e1f2b0e66a

View file

@ -5549,8 +5549,14 @@ void wlan_hdd_save_gtk_offload_params(struct hdd_adapter *adapter,
if (kck_ptr)
qdf_mem_copy(gtk_req->kck, kck_ptr, NL80211_KCK_LEN);
if (kek_ptr)
if (kek_ptr) {
/* paranoia */
if (kek_len > sizeof(gtk_req->kek)) {
kek_len = sizeof(gtk_req->kek);
QDF_ASSERT(0);
}
qdf_mem_copy(gtk_req->kek, kek_ptr, kek_len);
}
qdf_copy_macaddr(&gtk_req->bssid, &hdd_sta_ctx->conn_info.bssId);