Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8597aee authored by Lior David's avatar Lior David Committed by Hamad Kadmany
Browse files

wil6210: missing length check in wmi_set_ie



Add a length check in wmi_set_ie to detect unsigned integer
overflow.

Change-Id: Id1ec6a6218f3fe6e00cc3f9a8e674f8f843273f2
Signed-off-by: default avatarLior David <liord@codeaurora.org>
Signed-off-by: default avatarHamad Kadmany <hkadmany@codeaurora.org>
parent 2d4590be
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1426,8 +1426,14 @@ int wmi_set_ie(struct wil6210_priv *wil, u8 type, u16 ie_len, const void *ie)
	};
	int rc;
	u16 len = sizeof(struct wmi_set_appie_cmd) + ie_len;
	struct wmi_set_appie_cmd *cmd = kzalloc(len, GFP_KERNEL);
	struct wmi_set_appie_cmd *cmd;

	if (len < ie_len) {
		rc = -EINVAL;
		goto out;
	}

	cmd = kzalloc(len, GFP_KERNEL);
	if (!cmd) {
		rc = -ENOMEM;
		goto out;