mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
qtnfmac: Fix possible buffer overflow in qtnf_event_handle_external_auth
[ Upstream commit 130f634da1 ]
Function qtnf_event_handle_external_auth calls memcpy without
checking the length.
A user could control that length and trigger a buffer overflow.
Fix by checking the length is within the maximum allowed size.
Signed-off-by: Lee Gibson <leegib@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210419145842.345787-1-leegib@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ededc7325d
commit
bece6aea36
|
|
@ -570,8 +570,10 @@ qtnf_event_handle_external_auth(struct qtnf_vif *vif,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ev->ssid_len) {
|
if (ev->ssid_len) {
|
||||||
memcpy(auth.ssid.ssid, ev->ssid, ev->ssid_len);
|
int len = clamp_val(ev->ssid_len, 0, IEEE80211_MAX_SSID_LEN);
|
||||||
auth.ssid.ssid_len = ev->ssid_len;
|
|
||||||
|
memcpy(auth.ssid.ssid, ev->ssid, len);
|
||||||
|
auth.ssid.ssid_len = len;
|
||||||
}
|
}
|
||||||
|
|
||||||
auth.key_mgmt_suite = le32_to_cpu(ev->akm_suite);
|
auth.key_mgmt_suite = le32_to_cpu(ev->akm_suite);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user