Re: [PATCH] of: address: Unify resource bounds overflow checking

From: Rob Herring (Arm)
Date: Fri Sep 06 2024 - 17:34:41 EST



On Fri, 06 Sep 2024 14:25:19 +0200, Thomas Weißschuh wrote:
> The members "start" and "end" of struct resource are of type
> "resource_size_t" which can be 32bit wide.
> Values read from OF however are always 64bit wide.
>
> Refactor the diff overflow checks into a helper function.
> Also extend the checks to validate each calculation step.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
> ---
> drivers/of/address.c | 45 ++++++++++++++++++++++++++-------------------
> 1 file changed, 26 insertions(+), 19 deletions(-)
>

Applied, thanks!