OSDN Git Service

rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 5 Jun 2018 11:31:39 +0000 (14:31 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 27 Jun 2018 16:06:42 +0000 (19:06 +0300)
commitae636fb1554833ee5133ca47bf4b2791b6739c52
tree8804c6230882f956be4fcf0d7f9dd62ca78a1a7e
parent8668f9a57c8c551f3e6a45d2733e64686c7b7904
rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication()

This is a static checker fix, not something I have tested.  The issue
is that on the second iteration through the loop, we jump forward by
le32_to_cpu(auth_req->length) bytes.  The problem is that if the length
is more than "buflen" then we end up with a negative "buflen".  A
negative buflen is type promoted to a high positive value and the loop
continues but it's accessing beyond the end of the buffer.

I believe the "auth_req->length" comes from the firmware and if the
firmware is malicious or buggy, you're already toasted so the impact of
this bug is probably not very severe.

Fixes: 030645aceb3d ("rndis_wlan: handle 802.11 indications from device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/rndis_wlan.c