mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-12 15:49:17 -04:00
qcacmn: Fix the invalid MAC address config issue in TDLS
When an invalid mac address(all zeros 00:00:00:00:00:00) sent to the host via user configuration, it triggers the crash in the system. Add checks to reject the invalid mac address configuration in TDLS. Change-Id: I340f581e7011f78faf5f58c10f7b6eec15ea2940 CRs-Fixed: 2068026
This commit is contained in:
parent
ff86e37d20
commit
7419feb01e
1 changed files with 33 additions and 0 deletions
|
|
@ -39,6 +39,19 @@
|
|||
|
||||
#define TDLS_MAX_NO_OF_2_4_CHANNELS 14
|
||||
|
||||
static int wlan_cfg80211_tdls_validate_mac_addr(const uint8_t *mac)
|
||||
{
|
||||
static const uint8_t temp_mac[QDF_MAC_ADDR_SIZE] = {0};
|
||||
|
||||
if (!qdf_mem_cmp(mac, temp_mac, QDF_MAC_ADDR_SIZE)) {
|
||||
cfg80211_debug("Invalid Mac address " QDF_MAC_ADDRESS_STR " cmd declined.",
|
||||
QDF_MAC_ADDR_ARRAY(mac));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_cfg80211_tdls_priv_init(struct vdev_osif_priv *osif_priv)
|
||||
{
|
||||
struct osif_tdls_vdev *tdls_priv;
|
||||
|
|
@ -147,6 +160,11 @@ int wlan_cfg80211_tdls_add_peer(struct wlan_objmgr_pdev *pdev,
|
|||
struct osif_tdls_vdev *tdls_priv;
|
||||
unsigned long rc;
|
||||
|
||||
status = wlan_cfg80211_tdls_validate_mac_addr(mac);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
cfg80211_debug("Add TDLS peer " QDF_MAC_ADDRESS_STR,
|
||||
QDF_MAC_ADDR_ARRAY(mac));
|
||||
vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(pdev, dev->dev_addr,
|
||||
|
|
@ -357,6 +375,11 @@ int wlan_cfg80211_tdls_update_peer(struct wlan_objmgr_pdev *pdev,
|
|||
struct osif_tdls_vdev *tdls_priv;
|
||||
unsigned long rc;
|
||||
|
||||
status = wlan_cfg80211_tdls_validate_mac_addr(mac);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
cfg80211_debug("Update TDLS peer " QDF_MAC_ADDRESS_STR,
|
||||
QDF_MAC_ADDR_ARRAY(mac));
|
||||
vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(pdev, dev->dev_addr,
|
||||
|
|
@ -484,6 +507,11 @@ int wlan_cfg80211_tdls_oper(struct wlan_objmgr_pdev *pdev,
|
|||
unsigned long rc;
|
||||
enum tdls_command_type cmd;
|
||||
|
||||
status = wlan_cfg80211_tdls_validate_mac_addr(peer);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (NL80211_TDLS_DISCOVERY_REQ == oper) {
|
||||
cfg80211_warn(
|
||||
"We don't support in-driver setup/teardown/discovery");
|
||||
|
|
@ -622,6 +650,11 @@ int wlan_cfg80211_tdls_mgmt(struct wlan_objmgr_pdev *pdev,
|
|||
struct tdls_validate_action_req chk_frame;
|
||||
struct tdls_set_responder_req set_responder;
|
||||
|
||||
status = wlan_cfg80211_tdls_validate_mac_addr(peer_mac);
|
||||
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_macaddr_from_pdev(pdev,
|
||||
dev->dev_addr,
|
||||
WLAN_OSIF_ID);
|
||||
|
|
|
|||
Loading…
Reference in a new issue