qcacld-3.0: Fix buffer overflow in process_tx_info and process_rx_info

Currently data in "pl_tgt_hdr" is used directly from firmware without
any length check which may cause buffer over-read.

To address this issue add length check before accessing data offset

Change-Id: Ic2930fdf7168b79a8522be282b0e1cd19214742a
CRs-Fixed: 2148631
このコミットが含まれているのは:
Alok Kumar
2018-01-24 17:40:30 +05:30
committed by nshrivas
コミット 504230b163
2個のファイルの変更15行の追加1行の削除

ファイルの表示

@@ -467,7 +467,16 @@ static void htt_t2h_lp_msg_handler(void *context, qdf_nbuf_t htt_t2h_msg,
#ifndef REMOVE_PKT_LOG
case HTT_T2H_MSG_TYPE_PKTLOG:
{
pktlog_process_fw_msg(msg_word + 1);
uint32_t len = qdf_nbuf_len(htt_t2h_msg);
if (len < sizeof(*msg_word) + sizeof(uint32_t)) {
qdf_print("%s: invalid nbuff len \n", __func__);
WARN_ON(1);
break;
}
/*len is reduced by sizeof(*msg_word)*/
pktlog_process_fw_msg(msg_word + 1, len - sizeof(*msg_word));
break;
}
#endif

ファイルの表示

@@ -1324,6 +1324,11 @@ struct ol_rx_remote_data {
uint8_t mac_id;
};
struct ol_fw_data {
void *data;
uint32_t len;
};
#define INVALID_REORDER_INDEX 0xFFFF
#define SPS_DESC_SIZE 8