[lvc-project] [PATCH net-next] tcp: fix incorrect parameter validation in the do_tcp_getsockopt() function
Gavrilov Ilia
Ilia.Gavrilov at infotecs.ru
Wed Mar 6 14:54:40 MSK 2024
On 3/6/24 14:36, Paolo Abeni wrote:
> The above is incorrect, as the 'len' variable is a signed integer
I mean, if 'len' is negative then after this expression
len = min_t(unsigned int, len, sizeof(int));
the 'len' variable will be equal to sizeof(int) == 4
and the statement
if (len < 0) return -EINVAL;
might be unreachable during program execution.
More information about the lvc-project
mailing list