Преглед изворни кода

qcacld-3.0: Fix incorrect memory comparison in cds_is_mmie_valid

Fix incorrect memory comparison cds_is_mmie_valid.

In cds_is_mmie_valid(), while processing Rx Robust Management Frame
invalid condition usage results in incorrectly tagging the Rx packet for
replay attack. Similar invalid condition results in incorrectly
tagging the packets for MIC mismatch. This change will update the checks
so that Rx packets will not be dropped incorrectly.

Change-Id: I50974232db034029747e0af8c8b5b70959c4dcb7
CRs-Fixed: 1057261
Krishna Kumaar Natarajan пре 8 година
родитељ
комит
a7315f2414
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      core/cds/src/cds_utils.c

+ 2 - 2
core/cds/src/cds_utils.c

@@ -483,7 +483,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
 
 	/* Validate IPN */
 	rx_ipn = mmie->sequence_number;
-	if (OS_MEMCMP(rx_ipn, ipn, CMAC_IPN_LEN) > 0) {
+	if (OS_MEMCMP(rx_ipn, ipn, CMAC_IPN_LEN) <= 0) {
 		/* Replay error */
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 			  "Replay error mmie ipn %02X %02X %02X %02X %02X %02X"
@@ -546,7 +546,7 @@ cds_is_mmie_valid(uint8_t *igtk, uint8_t *ipn, uint8_t *frm, uint8_t *efrm)
 		  mic[0], mic[1], mic[2], mic[3],
 		  mic[4], mic[5], mic[6], mic[7]);
 
-	if (OS_MEMCMP(mic, mmie->mic, CMAC_TLEN) == 0) {
+	if (OS_MEMCMP(mic, mmie->mic, CMAC_TLEN) != 0) {
 		/* MMIE MIC mismatch */
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 			  "BC/MC MGMT frame MMIE MIC check Failed"