Browse Source

qcacld-3.0: Check peer address before peer create

Check peer address for group or zero before peer create
as there is no way a MGMT frame can be sent to such
a peer, and it also may lead to peer leak in FW, if
this peer is created, as peer delete doesn't go for
such a peer.

Fix is to have a sanity check and then only allow
peer create in host and FW.

Change-Id: Ia7f9e870f10ff8fea5b03f01697370d05ca06668
CRs-Fixed: 2392771
gaurank kathpalia 6 years ago
parent
commit
2e1aa99e00
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/wma/src/wma_dev_if.c

+ 6 - 0
core/wma/src/wma_dev_if.c

@@ -2030,6 +2030,12 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, struct cdp_pdev *pdev,
 		goto err;
 	}
 
+	if (qdf_is_macaddr_group((struct qdf_mac_addr *)peer_addr) ||
+	    qdf_is_macaddr_zero((struct qdf_mac_addr *)peer_addr)) {
+		WMA_LOGE("Invalid peer address received reject it");
+		goto err;
+	}
+
 	/*
 	 * Check if peer with same MAC exist on other Vdev, If so avoid
 	 * adding this peer, as it will cause FW to crash.