summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Kumaar Natarajan <kknatara@codeaurora.org>2016-08-20 17:54:20 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-08-27 16:04:57 -0700
commita7315f2414da625d2bd9e58558eaa9e483f2ef92 (patch)
treef682549c90b5f0245eff93a2987c3c1027f4aa46
parent8b22a7b23251c5cd555fbd087b5f79344d034f0e (diff)
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
-rw-r--r--core/cds/src/cds_utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/cds/src/cds_utils.c b/core/cds/src/cds_utils.c
index 68726fdee775..67d6d3f2494f 100644
--- a/core/cds/src/cds_utils.c
+++ b/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"