[PATCH v2 03/11] boot: imagemap: correct the lookup guard rationale
Simon Glass
sjg at chromium.org
Fri Oct 23 04:37:33 PDT 2026
On 2026-10-21T14:08:59, Daniel Golle <daniel at makrotopia.org> wrote:
> boot: imagemap: correct the lookup guard rationale
>
> The comment on imagemap_lookup() attributes the need for its second
> guard to ulong and loff_t sharing a rank on LP64. The rank wording is
> wrong: loff_t is a signed long long, which outranks ulong on ILP32, so
> the subtraction in (3) stays signed there and an underflowing offset
> simply fails the size comparison. It is on LP64, where the two have
> the same width but different signedness, that the usual arithmetic
> conversions turn the subtraction unsigned and make it wrap, letting
> every range appear to fit.
>
> State the actual reason.
>
> Signed-off-by: Daniel Golle <daniel at makrotopia.org>
>
> boot/imagemap.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
Reviewed-by: Simon Glass <sjg at chromium.org>
More information about the openwrt-devel
mailing list