Re: [PATCH 80/82] xen-netback: Refactor intentional wrap-around test

From: Jan Beulich
Date: Tue Jan 23 2024 - 02:56:08 EST


On 23.01.2024 01:27, Kees Cook wrote:
> --- a/drivers/net/xen-netback/hash.c
> +++ b/drivers/net/xen-netback/hash.c
> @@ -345,7 +345,7 @@ u32 xenvif_set_hash_mapping(struct xenvif *vif, u32 gref, u32 len,
> .flags = GNTCOPY_source_gref
> }};
>
> - if ((off + len < off) || (off + len > vif->hash.size) ||
> + if ((add_would_overflow(off, len)) || (off + len > vif->hash.size) ||

I'm not maintainer of this code, but if I was I would ask that the
excess parentheses be removed, to improve readability.

Jan