From: Tristan Madani <tristmd@gmail.com>
To: Ajay Singh <ajay.kathat@microchip.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org,
Tristan Madani <tristan@talencesecurity.com>
Subject: [PATCH v3 2/2] wifi: wilc1000: fix OOB read from firmware RX packet header fields
Date: Tue, 21 Apr 2026 13:50:01 +0000 [thread overview]
Message-ID: <20260421135001.343596-3-tristmd@gmail.com> (raw)
In-Reply-To: <20260421135001.343596-1-tristmd@gmail.com>
From: Tristan Madani <tristan@talencesecurity.com>
The firmware-controlled pkt_len, tp_len, and pkt_offset fields from RX
frame headers are used without validation against the buffer size. This
allows a malicious or malfunctioning firmware to cause out-of-bounds
reads from the RX buffer via wilc_frmw_to_host() and
wilc_wfi_mgmt_rx() memcpy operations.
Add bounds checks to ensure tp_len does not exceed remaining buffer
space, and pkt_len + pkt_offset fits within tp_len.
Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
Changes in v3:
- Regenerated from wireless-next with proper git format-patch to
produce valid index hashes (v2 had post-processed index lines).
Changes in v2:
- No code changes from v1.
drivers/net/wireless/microchip/wilc1000/wlan.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index 3fa8592eb2503..18024287f56a6 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -1123,6 +1123,11 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size)
if (pkt_len == 0 || tp_len == 0)
break;
+ if (tp_len > size - offset || pkt_len > tp_len) {
+ dev_err(wilc->dev, "invalid RX header: tp=%u pkt=%u remain=%d\n",
+ tp_len, pkt_len, size - offset);
+ break;
+ }
if (pkt_offset & IS_MANAGMEMENT) {
buff_ptr += HOST_HDR_OFFSET;
wilc_wfi_mgmt_rx(wilc, buff_ptr, pkt_len,
--
2.47.3
prev parent reply other threads:[~2026-04-21 13:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 13:49 [PATCH v3 0/2] wifi: wilc1000: firmware trust boundary hardening Tristan Madani
2026-04-21 13:50 ` [PATCH v3 1/2] wifi: wilc1000: fix integer underflow in wilc_network_info_received() Tristan Madani
2026-04-22 21:26 ` Johannes Berg
2026-04-21 13:50 ` Tristan Madani [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260421135001.343596-3-tristmd@gmail.com \
--to=tristmd@gmail.com \
--cc=ajay.kathat@microchip.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=tristan@talencesecurity.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox