[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211117133712.41d415ab@hermes.local>
Date: Wed, 17 Nov 2021 13:37:12 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Maxim Petrov <mmrmaximuzz@...il.com>
Cc: netdev@...r.kernel.org, David Miller <davem@...emloft.net>
Subject: Re: [PATCH iproute2] ip/ipnexthop: fix unsigned overflow in
parse_nh_group_type_res()
On Wed, 17 Nov 2021 22:11:24 +0300
Maxim Petrov <mmrmaximuzz@...il.com> wrote:
> 0UL has type 'unsigned long' which is likely to be 64bit on modern machines. At
> the same time, the '{idle,unbalanced}_timer' variables are declared as u32, so
> these variables cannot be greater than '~0UL / 100' when 'unsigned long' is 64
> bits. In such condition it is still possible to pass the check but get the
> overflow later when the timers are multiplied by 100 in 'addattr32'.
>
> Fix the possible overflow by changing '~0UL' to 'UINT32_MAX'.
>
> Signed-off-by: Maxim Petrov <mmrmaximuzz@...il.com>
Fixes: 91676718228b ("nexthop: Add support for resilient nexthop groups")
Powered by blists - more mailing lists