Skip to content

Commit

Permalink
ath6kl: wmi: prevent a shift wrapping bug in ath6kl_wmi_delete_pstrea…
Browse files Browse the repository at this point in the history
…m_cmd()

[ Upstream commit 6a95075 ]

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: 8fffd9e ("ath6kl: Implement support for QOS-enable and QOS-disable from userspace")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200918142732.GA909725@mwanda
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Oct 29, 2020
1 parent b35530d commit af4eada
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/ath/ath6kl/wmi.c
Expand Up @@ -2645,6 +2645,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;
Expand Down

0 comments on commit af4eada

Please sign in to comment.