Quellcode durchsuchen

msm: ipa3: Added pdn config type check

Added check to verify pdn config type
which may cause out-of-bounds read in wlan_msg_process.

Change-Id: Idce7cb966a5a1c33d4f6b040f4f9d2ec4fb203be
Signed-off-by: raghavendar rao l <[email protected]>
raghavendar rao l vor 4 Jahren
Ursprung
Commit
101eb82cbd
1 geänderte Dateien mit 7 neuen und 0 gelöschten Zeilen
  1. 7 0
      drivers/platform/msm/ipa/ipa_v3/ipa.c

+ 7 - 0
drivers/platform/msm/ipa/ipa_v3/ipa.c

@@ -919,6 +919,13 @@ static int ipa3_send_pdn_config_msg(unsigned long usr_param)
 
 	msg_meta.msg_type = pdn_info->pdn_cfg_type;
 
+	if ((pdn_info->pdn_cfg_type < IPA_PDN_DEFAULT_MODE_CONFIG) ||
+			(pdn_info->pdn_cfg_type >= IPA_PDN_CONFIG_EVENT_MAX)) {
+		IPAERR_RL("invalid pdn_cfg_type =%d", pdn_info->pdn_cfg_type);
+		kfree(pdn_info);
+		return -EINVAL;
+	}
+
 	IPADBG("type %d, interface name: %s, enable:%d\n", msg_meta.msg_type,
 		pdn_info->dev_name, pdn_info->enable);