lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191015074426.GA8715@infradead.org>
Date:   Tue, 15 Oct 2019 00:44:26 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Bart Van Assche <bvanassche@....org>
Cc:     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, kernel-janitors@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: fix unintended sign extension on left shifts

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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ