소스 검색

qcacmn: Check wmi service ext2 bit set with caution

Currently while checking for wmi service bit,  if
service bit is part of service ext2, host is not
validating if service bit index is valid or not,
and returns incorrect value.

For example, if host is checking for
WMI_SERVICE_PDEV_PARAM_IN_UTF_WMI and
num_wmi_service_ext_bitmap value is 4 then this service
bit can't be set, but seeing this value is set.

To address this issue if service ext2 bit
index is valid or not.

Change-Id: Ie4c766219e3793b46fa88dddb9544786142b92ef
CRs-Fixed: 3662190
Asutosh Mohapatra 1 년 전
부모
커밋
3ed7625c2a
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      wmi/src/wmi_unified_tlv.c

+ 8 - 0
wmi/src/wmi_unified_tlv.c

@@ -6805,6 +6805,14 @@ static bool is_service_enabled_tlv(wmi_unified_t wmi_handle,
 			return false;
 		}
 
+		if (service_id > WMI_MAX_EXT_SERVICE &&
+		    (service_id - WMI_MAX_EXT_SERVICE) / 32 >=
+		    soc->wmi_ext2_service_bitmap_len) {
+			wmi_err("WMI service ext2 bit = %d is not advertised by fw",
+				service_id);
+			return false;
+		}
+
 		return WMI_SERVICE_EXT2_IS_ENABLED(soc->wmi_service_bitmap,
 				soc->wmi_ext_service_bitmap,
 				soc->wmi_ext2_service_bitmap,