kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Colin King <colin.king@canonical.com>
Cc: Mustafa Ismail <mustafa.ismail@intel.com>,
	Shiraz Saleem <shiraz.saleem@intel.com>,
	Doug Ledford <dledford@redhat.com>,
	linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] RDMA/irdma: Fix issues with u8 left shift operation
Date: Mon, 7 Jun 2021 20:45:42 -0300	[thread overview]
Message-ID: <20210607234542.GA840331@nvidia.com> (raw)
In-Reply-To: <20210605122059.25105-1-colin.king@canonical.com>

On Sat, Jun 05, 2021 at 01:20:59PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The shifting of the u8 integer info->map[i] the left will be promoted
> to a 32 bit signed int and then sign-extended to a u64. In the event
> that the top bit of the u8 is set then all then all the upper 32 bits
> of the u64 end up as also being set because of the sign-extension.
> Fix this by casting the u8 values to a u64 before the left shift. This
> 
> Addresses-Coverity: ("Unitentional integer overflow / bad shift operation")
> Fixes: 3f49d6842569 ("RDMA/irdma: Implement HW Admin Queue OPs")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> Acked-by: Shiraz Saleem <shiraz.saleem@intel.com>
> ---
>  drivers/infiniband/hw/irdma/ctrl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next, thanks

Jason

      parent reply	other threads:[~2021-06-07 23:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-05 12:20 [PATCH][next] RDMA/irdma: Fix issues with u8 left shift operation Colin King
2021-06-07 14:54 ` Saleem, Shiraz
2021-06-07 23:45 ` Jason Gunthorpe [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=20210607234542.GA840331@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=colin.king@canonical.com \
    --cc=dledford@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mustafa.ismail@intel.com \
    --cc=shiraz.saleem@intel.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).