From: Ido Schimmel <idosch@idosch.org>
To: Maxim Petrov <mmrmaximuzz@gmail.com>
Cc: netdev@vger.kernel.org,
Stephen Hemminger <stephen@networkplumber.org>,
David Miller <davem@davemloft.net>
Subject: Re: [PATCH iproute2] ip/ipnexthop: fix unsigned overflow in parse_nh_group_type_res()
Date: Thu, 18 Nov 2021 11:14:31 +0200 [thread overview]
Message-ID: <YZYZd7ybCb98+XoT@shredder> (raw)
In-Reply-To: <91362fa6-46df-c134-63b1-cc2b0d2832ee@gmail.com>
On Wed, Nov 17, 2021 at 10:11:24PM +0300, Maxim Petrov 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@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
prev parent reply other threads:[~2021-11-18 9:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 19:11 [PATCH iproute2] ip/ipnexthop: fix unsigned overflow in parse_nh_group_type_res() Maxim Petrov
2021-11-17 21:37 ` Stephen Hemminger
2021-11-18 9:14 ` Ido Schimmel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YZYZd7ybCb98+XoT@shredder \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=mmrmaximuzz@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).