[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210607234542.GA840331@nvidia.com>
Date: Mon, 7 Jun 2021 20:45:42 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Colin King <colin.king@...onical.com>
Cc: Mustafa Ismail <mustafa.ismail@...el.com>,
Shiraz Saleem <shiraz.saleem@...el.com>,
Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] RDMA/irdma: Fix issues with u8 left shift operation
On Sat, Jun 05, 2021 at 01:20:59PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.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@...onical.com>
> Acked-by: Shiraz Saleem <shiraz.saleem@...el.com>
> ---
> drivers/infiniband/hw/irdma/ctrl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-next, thanks
Jason
Powered by blists - more mailing lists