qcacld-3.0: Use pdev iterate obj list to check for existing WAPI STA

At present, WAPI security mode STA is not allowed to run in
concurerncy with any other vdev.
So, whenever a new vdev is created, policy_mgr_check_privacy_for_new_conn
is called to check the security concurrency of new connection by checking
security of exisitng vdevs and if a STA vdev with WAPI security exists
then the concurrency is not allowed and the api will return false.

In case, while performing this check, the adaptor associated with
the existing vdev is destroyed, there might be a crash as
hdd_wapi_security_sta_exist is still trying to access the security
of that vdev.

To solve this, use wlan_objmgr_pdev_iterate_obj_list with crypto info
to iterate across all the existing vdev and check the security. If
Wapi security STA exists, it will return an argument with value as true
which will be used in policy_mgr_check_privacy_for_new_conn and it will
return false as concurrency is not allowed

Change-Id: Iff811d2406f1c74cec26d457a2a682dd992710b8
CRs-Fixed: 2784406
此提交包含在:
Utkarsh Bhatnagar
2020-09-25 19:18:47 +05:30
提交者 snandini
父節點 a1952c8ae6
當前提交 7d9ab089a4
共有 6 個檔案被更改,包括 69 行新增41 行删除

查看文件

@@ -111,6 +111,21 @@ mlme_set_vdev_start_failed(struct wlan_objmgr_vdev *vdev, bool val);
*/
bool mlme_is_connection_fail(struct wlan_objmgr_vdev *vdev);
/**
* mlme_is_wapi_sta_active() - check sta with wapi security exists and is active
* @pdev: pdev pointer
*
* Return: true if sta with wapi security exists
*/
#ifdef FEATURE_WLAN_WAPI
bool mlme_is_wapi_sta_active(struct wlan_objmgr_pdev *pdev);
#else
static inline bool mlme_is_wapi_sta_active(struct wlan_objmgr_pdev *pdev)
{
return false;
}
#endif
QDF_STATUS mlme_set_bigtk_support(struct wlan_objmgr_vdev *vdev, bool val);
bool mlme_get_bigtk_support(struct wlan_objmgr_vdev *vdev);

查看文件

@@ -28,6 +28,7 @@
#include <../../core/src/vdev_mgr_ops.h>
#include "wlan_psoc_mlme_api.h"
#include "target_if_cm_roam_offload.h"
#include "wlan_crypto_global_api.h"
static struct vdev_mlme_ops sta_mlme_ops;
static struct vdev_mlme_ops ap_mlme_ops;
@@ -744,6 +745,50 @@ bool mlme_is_connection_fail(struct wlan_objmgr_vdev *vdev)
return mlme_priv->connection_fail;
}
#ifdef FEATURE_WLAN_WAPI
static void mlme_is_sta_vdev_wapi(struct wlan_objmgr_pdev *pdev,
void *object, void *arg)
{
struct wlan_objmgr_vdev *vdev = (struct wlan_objmgr_vdev *)object;
int32_t keymgmt;
bool *is_wapi_sta_exist = (bool *)arg;
QDF_STATUS status;
if (*is_wapi_sta_exist)
return;
if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE)
return;
status = wlan_vdev_is_up(vdev);
if (QDF_IS_STATUS_ERROR(status))
return;
keymgmt = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
if (keymgmt < 0)
return;
if (keymgmt & ((1 << WLAN_CRYPTO_KEY_MGMT_WAPI_PSK) |
(1 << WLAN_CRYPTO_KEY_MGMT_WAPI_CERT))) {
*is_wapi_sta_exist = true;
mlme_debug("wapi exist for Vdev: %d",
wlan_vdev_get_id(vdev));
}
}
bool mlme_is_wapi_sta_active(struct wlan_objmgr_pdev *pdev)
{
bool is_wapi_sta_exist = false;
wlan_objmgr_pdev_iterate_obj_list(pdev,
WLAN_VDEV_OP,
mlme_is_sta_vdev_wapi,
&is_wapi_sta_exist, 0,
WLAN_MLME_OBJMGR_ID);
return is_wapi_sta_exist;
}
#endif
QDF_STATUS mlme_set_assoc_type(struct wlan_objmgr_vdev *vdev,
enum vdev_assoc_type assoc_type)
{