CVE-2023-53213: wifi: brcmfmac: slab-out-of-bounds read in brcmf_get_assoc_ies()
In the Linux kernel, the following vulnerability has been resolved:
wifi: brcmfmac: slab-out-of-bounds read in brcmfgetassocies()
Fix a slab-out-of-bounds read that occurs in kmemdup() called from brcmfgetassocies(). The bug could occur when associnfo->reqlen, data from a URB provided by a USB device, is bigger than the size of buffer which is defined as WLEXTRABUFMAX.
Add the size check for reqlen/resplen of associnfo.
Found by a modified version of syzkaller.
[ 46.592467][ T7] ================================================================== [ 46.594687][ T7] BUG: KASAN: slab-out-of-bounds in kmemdup+0x3e/0x50 [ 46.596572][ T7] Read of size 3014656 at addr ffff888019442000 by task kworker/0:1/7 [ 46.598575][ T7] [ 46.599157][ T7] CPU: 0 PID: 7 Comm: kworker/0:1 Tainted: G O 5.14.0+ #145 [ 46.601333][ T7] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014 [ 46.604360][ T7] Workqueue: events brcmffweheventworker [ 46.605943][ T7] Call Trace: [ 46.606584][ T7] dumpstacklvl+0x8e/0xd1 [ 46.607446][ T7] printaddressdescription.constprop.0.cold+0x93/0x334 [ 46.608610][ T7] ? kmemdup+0x3e/0x50 [ 46.609341][ T7] kasanreport.cold+0x79/0xd5 [ 46.610151][ T7] ? kmemdup+0x3e/0x50 [ 46.610796][ T7] kasancheckrange+0x14e/0x1b0 [ 46.611691][ T7] memcpy+0x20/0x60 [ 46.612323][ T7] kmemdup+0x3e/0x50 [ 46.612987][ T7] brcmfgetassocies+0x967/0xf60 [ 46.613904][ T7] ? brcmfnotifyvifevent+0x3d0/0x3d0 [ 46.614831][ T7] ? lockchaincount+0x20/0x20 [ 46.615683][ T7] ? marklock.part.0+0xfc/0x2770 [ 46.616552][ T7] ? lockchaincount+0x20/0x20 [ 46.617409][ T7] ? marklock.part.0+0xfc/0x2770 [ 46.618244][ T7] ? lockchaincount+0x20/0x20 [ 46.619024][ T7] brcmfbssconnectdone.constprop.0+0x241/0x2e0 [ 46.620019][ T7] ? brcmfparseconfiguresecurity.isra.0+0x2a0/0x2a0 [ 46.620818][ T7] ? lockacquire+0x181f/0x5790 [ 46.621462][ T7] brcmfnotifyconnectstatus+0x448/0x1950 [ 46.622134][ T7] ? rcureadlockbhheld+0xb0/0xb0 [ 46.622736][ T7] ? brcmfcfg80211joinibss+0x7b0/0x7b0 [ 46.623390][ T7] ? findheldlock+0x2d/0x110 [ 46.623962][ T7] ? brcmffweheventworker+0x19f/0xc60 [ 46.624603][ T7] ? markheldlocks+0x9f/0xe0 [ 46.625145][ T7] ? lockdephardirqsonprepare+0x3e0/0x3e0 [ 46.625871][ T7] ? brcmfcfg80211joinibss+0x7b0/0x7b0 [ 46.626545][ T7] brcmffwehcalleventhandler.isra.0+0x90/0x100 [ 46.627338][ T7] brcmffweheventworker+0x557/0xc60 [ 46.627962][ T7] ? brcmffwehcalleventhandler.isra.0+0x100/0x100 [ 46.628736][ T7] ? rcureadlockschedheld+0xa1/0xd0 [ 46.629396][ T7] ? rcureadlockbhheld+0xb0/0xb0 [ 46.629970][ T7] ? lockdephardirqsonprepare+0x273/0x3e0 [ 46.630649][ T7] processonework+0x92b/0x1460 [ 46.631205][ T7] ? pwqdecnrinflight+0x330/0x330 [ 46.631821][ T7] ? rwlockbug.part.0+0x90/0x90 [ 46.632347][ T7] workerthread+0x95/0xe00 [ 46.632832][ T7] ? kthreadparkme+0x115/0x1e0 [ 46.633393][ T7] ? processonework+0x1460/0x1460 [ 46.633957][ T7] kthread+0x3a1/0x480 [ 46.634369][ T7] ? setkthreadstruct+0x120/0x120 [ 46.634933][ T7] retfromfork+0x1f/0x30 [ 46.635431][ T7] [ 46.635687][ T7] Allocated by task 7: [ 46.636151][ T7] kasansavestack+0x1b/0x40 [ 46.636628][ T7] kasankmalloc+0x7c/0x90 [ 46.637108][ T7] kmemcachealloctrace+0x19e/0x330 [ 46.637696][ T7] brcmfcfg80211attach+0x4a0/0x4040 [ 46.638275][ T7] brcmfattach+0x389/0xd40 [ 46.638739][ T7] brcmfusbprobe+0x12de/0x1690 [ 46.639279][ T7] usbprobeinterface+0x2aa/0x760 [ 46.639820][ T7] reallyprobe+0x205/0xb70 [ 46.640342][ T7] driverprobedevice+0 ---truncated---
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 3.13.0-194.245 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 4.4.0-1119.125 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 4.15.0-1166.181~14.04.1 - Upgrade
Upgrade
ubuntu/linux-lts-xenialto a version that resolves this vulnerability.Fixed in 4.4.0-241.275~14.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 4.4.0-241.275 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 4.4.0-1157.172 - Upgrade
Upgrade
ubuntu/linux-aws-hweto a version that resolves this vulnerability.Fixed in 4.15.0-1157.170~16.04.1 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 4.15.0-1166.181~16.04.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 4.15.0-1151.167~16.04.1 - Upgrade
Upgrade
ubuntu/linux-hweto a version that resolves this vulnerability.Fixed in 4.15.0-212.223~16.04.1 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 4.4.0-1120.130 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 4.15.0-1120.131~16.04.1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 4.4.0-1089.96 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 4.15.0-212.223 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 4.15.0-1157.170 - Upgrade
Upgrade
ubuntu/linux-aws-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1103.111~18.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-4.15to a version that resolves this vulnerability.Fixed in 4.15.0-1166.181 - Upgrade
Upgrade
ubuntu/linux-azure-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1109.115~18.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-4.15to a version that resolves this vulnerability.Fixed in 4.15.0-1151.167 - Upgrade
Upgrade
ubuntu/linux-gcp-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1106.115~18.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-150.167~18.04.1 - Upgrade
Upgrade
ubuntu/linux-ibm-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1050.55~18.04.1 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 4.15.0-1141.146 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 4.15.0-1120.131 - Upgrade
Upgrade
ubuntu/linux-oracle-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1102.111~18.04.1 - Upgrade
Upgrade
ubuntu/linux-raspi-5.4to a version that resolves this vulnerability.Fixed in 5.4.0-1086.97~18.04.1 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-2096.102 - Upgrade
Upgrade
ubuntu/linux-azure-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-2075.81 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-1112.123 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 4.15.0-2059.64 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.4.0-150.167 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.4.0-1103.111 - Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1037.41~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.4.0-1109.115 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1039.46~20.04.1 - Upgrade
Upgrade
ubuntu/linux-bluefieldto a version that resolves this vulnerability.Fixed in 5.4.0-1064.70 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.4.0-1106.115 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1035.43~20.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-73.80~20.04.1 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.4.0-1050.55 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1031.36~20.04.1 - Upgrade
Upgrade
ubuntu/linux-iotto a version that resolves this vulnerability.Fixed in 5.4.0-1017.18 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.4.0-1092.98 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-73.80~20.04.1 - Upgrade
Upgrade
ubuntu/linux-nvidia-tegra-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1014.14~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.4.0-1102.111 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1036.42~20.04.1 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.4.0-1086.97 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1034.38~20.04.1 - Upgrade
Upgrade
ubuntu/linux-xilinx-zynqmpto a version that resolves this vulnerability.Fixed in 5.4.0-1024.28 - Upgrade
Upgrade
ubuntu/linux-aws-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1103.111+fips1 - Upgrade
Upgrade
ubuntu/linux-azure-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1109.115+fips1 - Upgrade
Upgrade
ubuntu/linux-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1078.87 - Upgrade
Upgrade
ubuntu/linux-gcp-fipsto a version that resolves this vulnerability.Fixed in 5.4.0-1106.115+fips1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-73.80 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1037.41 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1039.46 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 5.15.0-1039.46.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1035.43 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1034.39 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1021.26 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1031.34 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1031.36 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1034.39 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-73.80 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1026.26 - Upgrade
Upgrade
ubuntu/linux-nvidia-tegrato a version that resolves this vulnerability.Fixed in 5.15.0-1014.14 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1036.42 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1030.32 - Upgrade
Upgrade
ubuntu/linux-bluefieldto a version that resolves this vulnerability.Fixed in 5.15.0-1017.19 - Upgrade
Upgrade
ubuntu/linux-intel-iot-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1028.33 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1039.42 - Compensating control
In brcmfmac, add size checks for assoc_info->req_len and assoc_info->resp_len before kmemdup(), ensuring lengths do not exceed the WL_EXTRA_BUF_MAX buffer size.
Event History
Frequently Asked Questions
What is the severity of CVE-2023-53213?
CVE-2023-53213 has been classified with a medium severity, indicating a potential risk to the system.
How do I fix CVE-2023-53213?
To fix CVE-2023-53213, you need to update the Linux kernel to the latest stable version that includes the patch for this vulnerability.
What systems are affected by CVE-2023-53213?
CVE-2023-53213 affects the Linux kernel, particularly the version that uses the brcmfmac driver.
What type of vulnerability is CVE-2023-53213?
CVE-2023-53213 is a slab-out-of-bounds read vulnerability found in the Linux kernel's brcmf_get_assoc_ies() function.
What are the potential risks of CVE-2023-53213?
The potential risks of CVE-2023-53213 include unauthorized access and potential information leaks due to improper memory handling.