Re: [PATCH 01/82] overflow: Expand check_add_overflow() for pointer addition

From: Kees Cook
Date: Fri Jan 26 2024 - 17:57:42 EST


On Fri, Jan 26, 2024 at 10:52:57PM +0000, Justin Stitt wrote:
> [...]
> > /**
> > * check_sub_overflow() - Calculate subtraction with overflow checking
>
> Does check_sub_overflow() deserve some more love in the future? I
> imagine "under"-flowing pointers is not at all common, though.

Yes, though I hadn't found any cases of it yet in the code, so I didn't
want to add a helper that would go unused. :)

> Nonetheless, this all looks good to me.
>
> Reviewed-by: Justin Stitt <justinstitt@xxxxxxxxxx>

Thanks!

--
Kees Cook