Переглянути джерело

qcacld-3.0: Validate FW provided mac address

Currently host driver does not validate the mac address which
it receives from FW and based on this mac address host derives
remaining mac addresses. If mac address from FW is multicast
or broadcast address then it will be treated as invalid mac
address and adapter creation will fail.

To address above issue, accept mac address provided by FW only
if it is a valid mac address else derive all the mac address
based on driver's internal logic.

Change-Id: I4c4b60cac082680df90016ec4ba63f744353771c
CRs-Fixed: 2853417
Ashish Kumar Dhanotiya 4 роки тому
батько
коміт
df52b010d4
1 змінених файлів з 2 додано та 4 видалено
  1. 2 4
      core/hdd/src/wlan_hdd_main.c

+ 2 - 4
core/hdd/src/wlan_hdd_main.c

@@ -2456,12 +2456,10 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg)
 	}
 
 	/* This can be extended to other configurations like ht, vht cap... */
-
-	if (!qdf_is_macaddr_zero(&cfg->hw_macaddr))
+	status = wlan_hdd_validate_mac_address(&cfg->hw_macaddr);
+	if (QDF_IS_STATUS_SUCCESS(status))
 		qdf_mem_copy(&hdd_ctx->hw_macaddr, &cfg->hw_macaddr,
 			     QDF_MAC_ADDR_SIZE);
-	else
-		hdd_info("hw_mac is zero");
 
 	hdd_ctx->target_fw_version = cfg->target_fw_version;
 	hdd_ctx->target_fw_vers_ext = cfg->target_fw_vers_ext;