From 0348f365416ea927055d1eaa8153090b142e9b81 Mon Sep 17 00:00:00 2001 From: Arun Kumar Khandavalli Date: Fri, 24 Nov 2023 14:42:04 +0530 Subject: [PATCH] qcacld-3.0: Implement crypto locking mechanism Implement a locking mechanism for retrieving and storing crypto keys. Currently, due to race condition, Host driver is fetching information in one thread while simultaneously writing key information in another thread, resulting in synchronization issues. This change is to add lock mechanism while reading and writing crypto keys. Change-Id: I156b619cf7c3c052ad3122a6f808d732fb5e4f51 CRs-Fixed: 3672330 --- .../umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c b/components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c index f6c6a0e20f..ad909e9b96 100644 --- a/components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c +++ b/components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c @@ -1704,6 +1704,7 @@ cm_install_link_vdev_keys(struct wlan_objmgr_vdev *vdev) return; } + wlan_crypto_aquire_lock(); for (i = 0; i < max_key_index; i++) { crypto_key = wlan_crypto_get_key(vdev, i); if (!crypto_key) @@ -1716,6 +1717,7 @@ cm_install_link_vdev_keys(struct wlan_objmgr_vdev *vdev) crypto_key->cipher_type); key_present = true; } + wlan_crypto_release_lock(); if (!key_present && mlo_mgr_is_link_switch_in_progress(vdev)) { mlme_err("No key found for link_id %d", link_id);