Browse Source

qcacmn: Add check to avoid adf_dp_trace_cb_table over read

The size of adf_dp_trace_cb_table array is 30, possible over
read of adf_dp_trace_cb_table array in adf_dp_add_record API.

Add index condition check for adf_dp_trace_cb_table to avoid
array over read.

CRs-Fixed: 1041684
Change-Id: I4f0f9dda239efd404dff3f92b68a45aaf71875ae
SaidiReddy Yenuga 8 years ago
parent
commit
186c3da226
1 changed files with 2 additions and 1 deletions
  1. 2 1
      qdf/linux/src/qdf_trace.c

+ 2 - 1
qdf/linux/src/qdf_trace.c

@@ -1201,7 +1201,8 @@ static void qdf_dp_add_record(enum QDF_DP_TRACE_ID code,
 	rec->pid = (in_interrupt() ? 0 : current->pid);
 	spin_unlock_bh(&l_dp_trace_lock);
 
-	if (g_qdf_dp_trace_data.live_mode || (print == true))
+	if ((g_qdf_dp_trace_data.live_mode || (print == true)) &&
+	    (rec->code < QDF_DP_TRACE_MAX))
 		qdf_dp_trace_cb_table[rec->code] (rec, index);
 }