[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e2a6d4c-b346-cb1b-7941-e247a0d0f8b2@acm.org>
Date: Mon, 14 Oct 2019 08:58:03 -0700
From: Bart Van Assche <bvanassche@....org>
To: Colin King <colin.king@...onical.com>,
"James E . J . Bottomley" <jejb@...ux.ibm.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
Tomohiro Kusumi <kusumi.tomohiro@...fujitsu.com>,
Kei Tokunaga <tokunaga.keiich@...fujitsu.com>,
Xiao Guangrong <xiaoguangrong@...fujitsu.com>,
linux-scsi@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: fix unintended sign extension on left shifts
On 10/14/19 5:16 AM, Colin King wrote:
> diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c
> index 0f17e7dac1b0..1d3a5a2dc229 100644
> --- a/drivers/scsi/scsi_trace.c
> +++ b/drivers/scsi/scsi_trace.c
> @@ -38,7 +38,7 @@ scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len)
> const char *ret = trace_seq_buffer_ptr(p);
> sector_t lba = 0, txlen = 0;
>
> - lba |= (cdb[2] << 24);
> + lba |= ((u64)cdb[2] << 24);
> lba |= (cdb[3] << 16);
> lba |= (cdb[4] << 8);
> lba |= cdb[5];
Have you considered to use get/put_unaligned_be*() instead of making the
above change?
Thanks,
Bart.
Powered by blists - more mailing lists