Re: [PATCH v2] iio: proximity: hx9023s: validate firmware size
From: Andy Shevchenko
Date: Sat Jul 11 2026 - 04:29:29 EST
On Sat, Jul 11, 2026 at 08:28:27AM +0545, Laxman Acharya Padhya wrote:
> hx9023s_send_cfg() copies the firmware into a counted flexible array and
> then reads fixed offsets from the copied data before walking register/value
> pairs starting at FW_DATA_OFFSET. A truncated firmware image can therefore
> make the driver read past the copied buffer during probe-time configuration
> loading.
>
> Reject firmware images that cannot contain the fixed header, reject images
> too large for the u16 fw_size field, and validate that the advertised
> register count fits in the remaining payload.
You send the same mail twice without any word saying why. On top of that both
times we got the mangled patch. Please, slow down and check first your email
and other configurations, send to yourself (perhaps different email address)
to check how the result will look like.
--
With Best Regards,
Andy Shevchenko