linux/drivers/net/wireless/microchip/wilc1000
Tianchu Chen c1ba7f7f18 wifi: wilc1000: fix RX buffer OOB-write in wilc_wlan_handle_isr_ext()
wilc_wlan_handle_isr_ext() takes the RX transfer size from the
device-reported interrupt status register (a 15-bit field shifted left by 2,
up to 131068 bytes) and reads that many bytes from the device into
rx_buffer, which is only WILC_RX_BUFF_SIZE (96K) large. The wrap
check only handles the current offset; the size itself is never
compared against the buffer, so a bogus SDIO device can make the driver
OOB-write rx_buffer by up to ~32K with data it controls.

The oversized transfer also leaves rx_buffer_offset past the end of
the buffer, after which the unsigned wrap check stops working and
the overflow can repeat.

Drop any transfer whose size exceeds the RX buffer, acknowledging
the data interrupt and re-arming the RX engine so the bogus frame is
discarded and reception can continue. This also restores the
rx_buffer_offset <= WILC_RX_BUFF_SIZE invariant the wrap check
relies on.

This is not expected to change driver behavior in most cases:
without this check, an oversized transfer would most likely
corrupt neighboring kernel memory instead of completing anyway, and
the drop path performs the same interrupt acknowledgment and RX
engine re-arming as the normal path, so subsequent transfers are
received unaffected.

Discovered by Atuin - Automated Vulnerability Discovery Engine.

Fixes: c5c77ba18e ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Cc: stable@vger.kernel.org
Assisted-by: LLM
Signed-off-by: Tianchu Chen <flynnnchen@tencent.com>
Link: https://patch.msgid.link/7c971924c6bdccf6c2f75704a5a746e9303aaf64@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2026-09-09 14:51:30 +02:00
..
cfg80211.c wifi: wilc1000: fix out-of-bounds read in P2P public action frames 2026-09-04 10:06:59 +02:00
cfg80211.h wifi: wilc1000: Register wiphy after reading out chipid 2024-10-17 19:47:42 +03:00
fw.h wifi: wilc1000: add function to read mac address from eFuse 2024-05-17 11:01:51 +03:00
hif.c wifi: wilc1000: validate assoc response length before subtracting header 2026-07-21 13:25:06 +02:00
hif.h wifi: wilc1000: set wilc_set_mac_address parameter as const 2024-05-17 11:01:51 +03:00
Kconfig wilc1000: Add support for enabling CRC 2021-04-17 20:47:40 +03:00
Makefile wilc1000: use API version number info along with firmware filename 2020-07-14 20:52:27 +03:00
mon.c wifi: wilc1000: validate monitor transmit frame headers 2026-08-02 18:23:27 +02:00
netdev.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
netdev.h wifi: wilc1000: remove suspend/resume from cfg80211 part 2024-06-18 13:23:16 +03:00
sdio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
spi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wlan_cfg.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
wlan_cfg.h wifi: wilc1000: avoid buffer overflow in WID string configuration 2025-09-03 09:39:32 +02:00
wlan_if.h wifi: wilc1000: Increase ASSOC response buffer 2023-05-11 15:53:44 +03:00
wlan.c wifi: wilc1000: fix RX buffer OOB-write in wilc_wlan_handle_isr_ext() 2026-09-09 14:51:30 +02:00
wlan.h wifi: wilc1000: Add WILC3000 support 2024-10-17 19:47:42 +03:00