Re: [PATCH v2 2/4] soc: qcom: geni-se: Widen fw_size to u32 to prevent wrap-around

From: Konrad Dybcio

Date: Thu Aug 20 2026 - 10:44:00 EST


On 8/20/26 4:30 PM, Viken Dadhaniya wrote:
> fw_size is read from the 16-bit fw_size_in_items field and incremented
> when the count is odd. If fw_size_in_items == 0xffff the increment
> wraps to 0 as a u16, making the bounds check below pass for a firmware
> segment whose actual size was not validated. Widen fw_size to u32 so
> the increment never wraps.
>
> Fixes: d4bf06592ad6 ("soc: qcom: geni-se: Add support to load QUP SE Firmware via Linux subsystem")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Viken Dadhaniya <viken.dadhaniya@xxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad