[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL+tcoBSkBG0SDnjDOzjqzpSFphrE-_Qyw_DcdcebHcRCU3xgw@mail.gmail.com>
Date: Wed, 6 Mar 2024 19:56:32 +0800
From: Jason Xing <kerneljasonxing@...il.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: Gavrilov Ilia <Ilia.Gavrilov@...otecs.ru>, Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>, David Ahern <dsahern@...nel.org>,
Jakub Kicinski <kuba@...nel.org>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lvc-project@...uxtesting.org" <lvc-project@...uxtesting.org>
Subject: Re: [PATCH net-next] tcp: fix incorrect parameter validation in the
do_tcp_getsockopt() function
Hello Paolo,
On Wed, Mar 6, 2024 at 7:36 PM Paolo Abeni <pabeni@...hat.com> wrote:
>
> On Wed, 2024-03-06 at 09:57 +0000, 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.
>
> The above is incorrect, as the 'len' variable is a signed integer
The 'len' variable should be converted to the non-negative value as
this sentence:
len = min_t(unsigned int, len, sizeof(int));
See the comments of min_t(): return minimum of two values, using the
specified type.
After executing the above code, it doesn't make sense to test if 'len
< 0', I think.
Thanks,
Jason
>
>
> The same applies to the following patches.
>
> Cheers,
>
> Paolo
>
>
Powered by blists - more mailing lists