qcacld-3.0: Acquire sme global lock if wait for set key times out
When the set key timeout occurs and there is a disconnect triggered from userspace during the set key timeout, then the disconnect proceeds to free the roam_profile for the csr session. And when the set key timeout handler csr_roam_wait_for_key_time_out_handler() is invoked, it tries to access the roam profile from csr_roam_link_up()-> csr_neighbor_roam_info_ctx_init(). This results in a race between the supplicant thread and scheduler thread. Acquire sme global lock before call to csr_roam_link_up() to avoid this deadlock. Change-Id: I1dd0bec7afa191648d064a1935a33d9612bb89bc CRs-Fixed: 2486186
This commit is contained in:
@@ -12577,18 +12577,18 @@ void csr_roam_wait_for_key_time_out_handler(void *pv)
|
|||||||
}
|
}
|
||||||
sme_debug("SME pre-auth state timeout");
|
sme_debug("SME pre-auth state timeout");
|
||||||
|
|
||||||
|
status = sme_acquire_global_lock(&mac->sme);
|
||||||
if (csr_is_conn_state_connected_infra(mac, session_id)) {
|
if (csr_is_conn_state_connected_infra(mac, session_id)) {
|
||||||
csr_roam_link_up(mac,
|
csr_roam_link_up(mac,
|
||||||
pSession->connectedProfile.bssid);
|
pSession->connectedProfile.bssid);
|
||||||
status = sme_acquire_global_lock(&mac->sme);
|
|
||||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||||
csr_roam_disconnect(mac, session_id,
|
csr_roam_disconnect(mac, session_id,
|
||||||
eCSR_DISCONNECT_REASON_UNSPECIFIED);
|
eCSR_DISCONNECT_REASON_UNSPECIFIED);
|
||||||
sme_release_global_lock(&mac->sme);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sme_err("session not found");
|
sme_err("session not found");
|
||||||
}
|
}
|
||||||
|
sme_release_global_lock(&mac->sme);
|
||||||
} else {
|
} else {
|
||||||
spin_unlock(&mac->roam.roam_state_lock);
|
spin_unlock(&mac->roam.roam_state_lock);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user