what you don't know can hurt you

Broadcom wl_iw_get_essid Heap Overflow

Broadcom wl_iw_get_essid Heap Overflow
Posted Apr 9, 2017
Authored by Google Security Research, laginimaineb

Broadcom suffers from a heap overflow vulnerability in wl_iw_get_essid when handling WLC_GET_SSID ioctl results.

tags | advisory, overflow
advisories | CVE-2017-0570
MD5 | 049106b14cc8169436d7ad3887a23d6f

Broadcom wl_iw_get_essid Heap Overflow

Change Mirror Download
 Broadcom: Heap overflow in "wl_iw_get_essid" when handling WLC_GET_SSID ioctl results 


Broadcom produces Wi-Fi HardMAC SoCs which are used to handle the PHY and MAC layer processing. These chips are present in both mobile devices and Wi-Fi routers, and are capable of handling many Wi-Fi related events without delegating to the host OS. On Android devices, the "bcmdhd" driver is used in order to communicate with the Wi-Fi SoC (also referred to as "dongle").

Along with the regular flow of frames transferred between the host and the dongle, the two communicate with one another via a set of "ioctls" which can be issued to read or write dongle configuration from the host. This information is exchanged using the SDIO "control" channel (SDPCM_CONTROL_CHANNEL) rather than the regular "data" and "glom" channels (which are used to transfer frames).

"bcmdhd" registers a set of handlers to support IW ioctls (which may be invoked on a socket descriptors where "iwreq.ifrname" points to a device entry exposed by the "bcmdhd" driver). These ioctls are handled by the "wl_iw_ioctl" function. The function first allocates an "extras" buffer of an appropriate size, according to the ioctl issued. Then, the function looks up the handler function matching the issued ioctl and invokes it, passing the allocated "extras" buffer as an argument.

When the "SIOCGIWESSID" ioctl is invoked (in order to query the current ESSID), the function allocates an extras buffer of size 33, and then invokes the internal handler function, "wl_iw_get_essid". Here is a short snippet from the handler:

1. wl_iw_get_essid(struct net_device *dev, struct iw_request_info *info,
2. struct iw_point *dwrq, char *extra)
3. {
4. wlc_ssid_t ssid;
5. int error;
6. if ((error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid)))) {
7. WL_ERROR(("Error getting the SSID\n"));
8. return error;
9. }
10. ssid.SSID_len = dtoh32(ssid.SSID_len);
11. memcpy(extra, ssid.SSID, ssid.SSID_len);
12. ...
13. }

Where "extra" is the extras buffer of size 33, allocated by "wl_iw_ioctl".

As can be seen above, the handler trusts the value of "ssid.SSID_len". An attacker controlling the dongle can re-write the ioctl handling function (since it is entirely RAM-resident), in order to control the results of the ioctl above. This would allow the attacker to return an arbitrarily large value for "ssid.SSID_len", causing the memcpy operation (line 11) to overflow the "extra" buffer.

I've been able to statically verify this issue on the "bcmdhd-3.10" driver, and in the corresponding "bcmdhd" driver on the Nexus 5 (hammerhead) and Nexus 6P's (angler) kernels.

This bug is subject to a 90 day disclosure deadline. If 90 days elapse
without a broadly available patch, then the bug report will automatically
become visible to the public.

Found by: laginimaineb

Login or Register to add favorites

File Archive:

October 2020

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    25 Files
  • 2
    Oct 2nd
    13 Files
  • 3
    Oct 3rd
    1 Files
  • 4
    Oct 4th
    1 Files
  • 5
    Oct 5th
    15 Files
  • 6
    Oct 6th
    15 Files
  • 7
    Oct 7th
    15 Files
  • 8
    Oct 8th
    11 Files
  • 9
    Oct 9th
    3 Files
  • 10
    Oct 10th
    1 Files
  • 11
    Oct 11th
    1 Files
  • 12
    Oct 12th
    8 Files
  • 13
    Oct 13th
    12 Files
  • 14
    Oct 14th
    23 Files
  • 15
    Oct 15th
    4 Files
  • 16
    Oct 16th
    13 Files
  • 17
    Oct 17th
    1 Files
  • 18
    Oct 18th
    1 Files
  • 19
    Oct 19th
    27 Files
  • 20
    Oct 20th
    41 Files
  • 21
    Oct 21st
    18 Files
  • 22
    Oct 22nd
    16 Files
  • 23
    Oct 23rd
    2 Files
  • 24
    Oct 24th
    1 Files
  • 25
    Oct 25th
    1 Files
  • 26
    Oct 26th
    17 Files
  • 27
    Oct 27th
    19 Files
  • 28
    Oct 28th
    29 Files
  • 29
    Oct 29th
    13 Files
  • 30
    Oct 30th
    8 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags


packet storm

© 2020 Packet Storm. All rights reserved.

Security Services
Hosting By