Commit 6a950755 authored by Dan Carpenter's avatar Dan Carpenter Committed by Kalle Valo
Browse files

ath6kl: wmi: prevent a shift wrapping bug in ath6kl_wmi_delete_pstream_cmd()



The "tsid" is a user controlled u8 which comes from debugfs.  Values
more than 15 are invalid because "active_tsids" is a 16 bit variable.
If the value of "tsid" is more than 31 then that leads to a shift
wrapping bug.

Fixes: 8fffd9e5 ("ath6kl: Implement support for QOS-enable and QOS-disable from userspace")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918142732.GA909725@mwanda
parent aac352d6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2639,6 +2639,11 @@ int ath6kl_wmi_delete_pstream_cmd(struct wmi *wmi, u8 if_idx, u8 traffic_class,
		return -EINVAL;
	}

	if (tsid >= 16) {
		ath6kl_err("invalid tsid: %d\n", tsid);
		return -EINVAL;
	}

	skb = ath6kl_wmi_get_new_buf(sizeof(*cmd));
	if (!skb)
		return -ENOMEM;