aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQiujun Huang <[email protected]>2020-03-26 21:18:50 +0800
committerGreg Kroah-Hartman <[email protected]>2020-03-26 15:47:26 +0100
commit1165dd73e811a07d947aee218510571f516081f6 (patch)
tree1a99baaf194dc26c8dfd731d6af03992985cad1b
parentb67b7b0465ff9cf89c11dd383d2888b29531f096 (diff)
staging: wlan-ng: fix use-after-free Read in hfa384x_usbin_callback
We can't handle the case length > WLAN_DATA_MAXLEN. Because the size of rxfrm->data is WLAN_DATA_MAXLEN(2312), and we can't read more than that. Thanks-to: Hillf Danton <[email protected]> Reported-and-tested-by: [email protected] Signed-off-by: Qiujun Huang <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/staging/wlan-ng/hfa384x_usb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c
index e38acb58cd5e..fa1bf8b069fd 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3376,6 +3376,8 @@ static void hfa384x_int_rxmonitor(struct wlandevice *wlandev,
WLAN_HDR_A4_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN)) {
pr_debug("overlen frm: len=%zd\n",
skblen - sizeof(struct p80211_caphdr));
+
+ return;
}
skb = dev_alloc_skb(skblen);