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:
Pragaspathi Thilagaraj
2019-07-10 12:33:33 +05:30
parent f40d6e75de
commit 6bfa475e45

View File

@@ -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);
} }