[PATCH 1/1] regmap: fix range checks

Simon Glass sjg at chromium.org
Fri Sep 30 15:28:49 CEST 2022


On Thu, 29 Sept 2022 at 16:27, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> On the 32bit ARM sandbox 'dm ut dm_test_devm_regmap' fails with an abort.
> This is due to incorrect range checks.
>
> On 32-bit systems the size of size_t and int is both 32 bit. The expression
> (offset + val_len) is bound to overflow if offset == -1. Add an overflow
> check.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
>  drivers/core/regmap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list