Re: [PATCH] scsi: fix unintended sign extension on left shifts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 14, 2019 at 08:58:03AM -0700, Bart Van Assche wrote:
> On 10/14/19 5:16 AM, Colin King wrote:
> >   	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?

Agreed, that is the only sensible thing to do here.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux