From: Simon Horman <horms@kernel.org>
To: Colin Ian King <colin.i.king@gmail.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
Tariq Toukan <tariqt@nvidia.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Moshe Shemesh <moshe@nvidia.com>,
Yevgeny Kliteynik <kliteyn@nvidia.com>,
Mark Bloch <mbloch@nvidia.com>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] net/mlx5: fix unintentional sign extension on shift of dest_attr->vport.vhca_id
Date: Fri, 17 Jan 2025 10:58:13 +0000 [thread overview]
Message-ID: <20250117105813.GL6206@kernel.org> (raw)
In-Reply-To: <20250116181700.96437-1-colin.i.king@gmail.com>
On Thu, Jan 16, 2025 at 06:17:00PM +0000, Colin Ian King wrote:
> Shifting dest_attr->vport.vhca_id << 16 results in a promotion from an
> unsigned 16 bit integer to a 32 bit signed integer, this is then sign
> extended to a 64 bit unsigned long on 64 bitarchitectures. If vhca_id is
> greater than 0x7fff then this leads to a sign extended result where all
> the upper 32 bits of idx are set to 1. Fix this by casting vhca_id
> to the same type as idx before performing the shift.
>
> Fixes: 8e2e08a6d1e0 ("net/mlx5: fs, add support for dest vport HWS action")
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2025-01-17 10:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 18:17 [PATCH][next] net/mlx5: fix unintentional sign extension on shift of dest_attr->vport.vhca_id Colin Ian King
2025-01-17 10:58 ` Simon Horman [this message]
2025-01-17 11:44 ` Moshe Shemesh
2025-01-18 4:00 ` patchwork-bot+netdevbpf
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=20250117105813.GL6206@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=colin.i.king@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kliteyn@nvidia.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=mbloch@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@nvidia.com \
/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).