Răsfoiți Sursa

qcacld-3.0: Validate length argument's lower boundary

While processing set key vendor command, lower boundary of key
length isn't validated properly, which might lead to buffer overflow.

Validate lower boundary of key length argument properly before
processing set key vendor command.

Change-Id: Ic7a6367db507e652a39a82c6489d64937f1b3429
CRs-Fixed: 2200948
Hanumanth Reddy Pothula 7 ani în urmă
părinte
comite
538748570c
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      core/hdd/src/wlan_hdd_cfg80211.c

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

@@ -5653,8 +5653,8 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 		return -EPERM;
 	}
 
-	if ((data == NULL) || (data_len == 0) ||
-			(data_len > SIR_ROAM_SCAN_PSK_SIZE)) {
+	if ((data == NULL) || (data_len <= 0) ||
+	    (data_len > SIR_ROAM_SCAN_PSK_SIZE)) {
 		hdd_err("Invalid data");
 		return -EINVAL;
 	}