Re: [PATCH] net: bnx2x: validate firmware section bounds without overflow
From: Andrew Lunn
Date: Mon Jul 06 2026 - 11:44:06 EST
On Mon, Jul 06, 2026 at 05:34:03PM +0800, Pengpeng Hou wrote:
> The firmware loader validates each section with offset + length before it
> uses section offsets to read data from the firmware image. Both fields are
> 32-bit values from the firmware header, so the addition can wrap before it
> is compared with the firmware size.
>
> Validate sections as offset <= size and length <= size - offset instead.
> Also require the firmware version section to contain the four bytes that
> bnx2x_check_firmware() reads later.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
Please stop posting patches. I gets very frustrating having to point
out again and again the same errors.
Please work on one patch. Make all the basic errors once, on one
patch, until you get it merged. Then post the next patch, hopefully
correctly.
Please reply to all your patches with:
pw-bot: cr
so that they get dropped from the review system, so they don't waste
our time.
Andrew