All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@mellanox.com>
To: Colin King <colin.king@canonical.com>
Cc: Jiri Pirko <jiri@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] mlxsw: spectrum_trap: fix unintention integer overflow on left shift
Date: Thu, 02 Apr 2020 15:48:59 +0000	[thread overview]
Message-ID: <20200402154859.GA2453139@splinter> (raw)
In-Reply-To: <20200402144851.565983-1-colin.king@canonical.com>

On Thu, Apr 02, 2020 at 03:48:51PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Shifting the integer value 1 is evaluated using 32-bit
> arithmetic and then used in an expression that expects a 64-bit
> value, so there is potentially an integer overflow. Fix this
> by using the BIT_ULL macro to perform the shift and avoid the
> overflow.
> 
> Addresses-Coverity: ("Unintentional integer overflow")
> Fixes: 13f2e64b94ea ("mlxsw: spectrum_trap: Add devlink-trap policer support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

For net:

Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>

Thanks

WARNING: multiple messages have this Message-ID (diff)
From: Ido Schimmel <idosch@mellanox.com>
To: Colin King <colin.king@canonical.com>
Cc: Jiri Pirko <jiri@mellanox.com>,
	"David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] mlxsw: spectrum_trap: fix unintention integer overflow on left shift
Date: Thu, 2 Apr 2020 18:48:59 +0300	[thread overview]
Message-ID: <20200402154859.GA2453139@splinter> (raw)
In-Reply-To: <20200402144851.565983-1-colin.king@canonical.com>

On Thu, Apr 02, 2020 at 03:48:51PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Shifting the integer value 1 is evaluated using 32-bit
> arithmetic and then used in an expression that expects a 64-bit
> value, so there is potentially an integer overflow. Fix this
> by using the BIT_ULL macro to perform the shift and avoid the
> overflow.
> 
> Addresses-Coverity: ("Unintentional integer overflow")
> Fixes: 13f2e64b94ea ("mlxsw: spectrum_trap: Add devlink-trap policer support")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

For net:

Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>

Thanks

  reply	other threads:[~2020-04-02 15:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-02 14:48 [PATCH][next] mlxsw: spectrum_trap: fix unintention integer overflow on left shift Colin King
2020-04-02 14:48 ` Colin King
2020-04-02 15:48 ` Ido Schimmel [this message]
2020-04-02 15:48   ` Ido Schimmel
2020-04-03  1:00 ` David Miller
2020-04-03  1:00   ` David Miller
2020-04-03  8:46 ` Dan Carpenter
2020-04-03  8:46   ` Dan Carpenter
2020-04-03 16:05 ` [PATCH][next] mlxsw: spectrum_trap: Fix unintentional " Markus Elfring
2020-04-03 16:05   ` Markus Elfring

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=20200402154859.GA2453139@splinter \
    --to=idosch@mellanox.com \
    --cc=colin.king@canonical.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.