Эх сурвалжийг харах

qcacld-3.0: Avoid Integer underflow in hdd_dns_make_name_query

In the function hdd_dns_make_name_query, the driver is performing a
validation check that includes the use of length of the received string
as an array index. As the length and string both are user controlled,
the user can send the length as zero. As the policy states that the
given attribute is NLA_BINARY, so there would be no validation check
that can ensure the correct input. Therefore in the case of a malformed
packet with null length string, it can cause a possible integer
underflow.

To avoid this vulnerability change the attribute type from NLA_BINARY to
NLA_NUL_STRING. This will cause all the checks to be performed at
validate_nla.

Change-Id: I0bb569b71a88a07745d364dad23cf1210af4212e
CRs-Fixed: 2409913
Sourav Mohapatra 6 жил өмнө
parent
commit
aaa0f882f6

+ 1 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -10603,7 +10603,7 @@ qca_wlan_vendor_set_nud_stats[STATS_SET_MAX + 1] = {
 const struct nla_policy
 qca_wlan_vendor_set_connectivity_check_stats[CONNECTIVITY_STATS_SET_MAX + 1] = {
 	[STATS_PKT_INFO_TYPE] = {.type = NLA_U32 },
-	[STATS_DNS_DOMAIN_NAME] = {.type = NLA_BINARY,
+	[STATS_DNS_DOMAIN_NAME] = {.type = NLA_NUL_STRING,
 					.len = DNS_DOMAIN_NAME_MAX_LEN },
 	[STATS_SRC_PORT] = {.type = NLA_U32 },
 	[STATS_DEST_PORT] = {.type = NLA_U32 },