Re: [PATCH net-next] udp: fix incorrect parameter validation in the udp_lib_getsockopt() function

From: Willem de Bruijn
Date: Thu Mar 07 2024 - 04:11:53 EST


Gavrilov Ilia wrote:
> The 'len' variable can't be negative because all 'min_t' parameters
> cast to unsigned int, and then the minimum one is chosen.
>
> To fix it, move the if statement higher.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Gavrilov Ilia <Ilia.Gavrilov@xxxxxxxxxxx>

Reviewed-by: Willem de Bruijn <willemb@xxxxxxxxxx>