Browse Source

qcacld-3.0: Resolve invalid memory access while processing GET STATES IOCTL

qcacld-2.0 to qcacld-3.0 propagation

While processing GET STATES IOCTL, in a while loop, HOST prints PE, LIM
and MLM states of each session. Normally while loading, HOST allocates
memory for five sessions, but while processing this IOCTL, it iterating
in a loop assuming there are 255 sessions allocated, leading to crash
because of invalid memory access.
Hence while printing PE, LIM and MLM states iterate only for allocated
number of sessions.

Change-Id: I29c9a627615a1983d23831578f45aefe116dac25
CRs-Fixed: 879950
Hanumantha Reddy Pothula 9 years ago
parent
commit
589fd70615
1 changed files with 4 additions and 0 deletions
  1. 4 0
      core/sme/src/common/sme_api.c

+ 4 - 0
core/sme/src/common/sme_api.c

@@ -9333,6 +9333,10 @@ uint32_t sme_get_lim_mlm_state(tHalHandle hHal)
 bool sme_is_lim_session_valid(tHalHandle hHal, uint8_t sessionId)
 {
 	tpAniSirGlobal pMac = PMAC_STRUCT(hHal);
+
+	if (sessionId > pMac->lim.maxBssId)
+		return false;
+
 	return pMac->lim.gpSession[sessionId].valid;
 }