From: Johannes Berg <johannes@sipsolutions.net>
To: Tristan Madani <tristmd@gmail.com>,
Ajay Singh <ajay.kathat@microchip.com>,
Claudiu Beznea <claudiu.beznea@tuxon.dev>
Cc: linux-wireless@vger.kernel.org,
Tristan Madani <tristan@talencesecurity.com>
Subject: Re: [PATCH v3 1/2] wifi: wilc1000: fix integer underflow in wilc_network_info_received()
Date: Wed, 22 Apr 2026 23:26:30 +0200 [thread overview]
Message-ID: <385e7ded5eea5896ca2fae92e5d7de9c3e497f6a.camel@sipsolutions.net> (raw)
In-Reply-To: <20260421135001.343596-2-tristmd@gmail.com>
> @@ -1594,7 +1595,15 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length)
> if (IS_ERR(msg))
> goto out;
>
> - msg->body.net_info.frame_len = get_unaligned_le16(&buffer[6]) - 1;
> + frame_len = get_unaligned_le16(&buffer[6]);
> + if (frame_len == 0 || frame_len > length - 9) {
> + netdev_err(vif->ndev,
> + "%s: invalid frame_len %u (buffer %u)\n",
> + __func__, frame_len, length);
> + kfree(msg);
> + goto out;
> + }
>
It seems it'd be trivial to check this *before* allocating the 'msg',
and be much better that way.
johannes
next prev parent reply other threads:[~2026-04-22 21:26 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 [this message]
2026-04-21 13:50 ` [PATCH v3 2/2] wifi: wilc1000: fix OOB read from firmware RX packet header fields Tristan Madani
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=385e7ded5eea5896ca2fae92e5d7de9c3e497f6a.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=ajay.kathat@microchip.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=linux-wireless@vger.kernel.org \
--cc=tristan@talencesecurity.com \
--cc=tristmd@gmail.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