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] [thread-next>] [day] [month] [year] [list]
Message-ID: <46BF6596.8040803@gmail.com>
Date:	Sun, 12 Aug 2007 21:55:02 +0200
From:	Rene Herman <rene.herman@...il.com>
To:	Al Viro <viro@....linux.org.uk>
CC:	Jesper Juhl <jesper.juhl@...il.com>, linux-scsi@...r.kernel.org,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Re: cciss: warning: right shift count >= width of type

On 08/12/2007 08:58 AM, Al Viro wrote:

> On Sun, Aug 12, 2007 at 03:21:57AM +0200, Rene Herman wrote:

>> +			c->Request.CDB[2]= ((u64)start_blk >> 56) & 0xff;	//MSB
>> +			c->Request.CDB[3]= ((u64)start_blk >> 48) & 0xff;
>> +			c->Request.CDB[4]= ((u64)start_blk >> 40) & 0xff;
>> +			c->Request.CDB[5]= ((u64)start_blk >> 32) & 0xff;
>> +			c->Request.CDB[6]= ((u64)start_blk >> 24) & 0xff;
>> +			c->Request.CDB[7]= ((u64)start_blk >> 16) & 0xff;
>> +			c->Request.CDB[8]= ((u64)start_blk >>  8) & 0xff;
> 
> 	put_unaligned(cpu_to_be64(start_blk), &c->Request.CDB[2]);
> 
> which is what's happening here anyway.

Well, yes. There are a few more of these in the driver and this wants a 
maintainer (whom I can't reach @hp.com) comment.

Is that 16-bit one for CCISS_READ_10 really right? Either:

put_unaligned(cpu_to_be32(creq->nr_sectors), &c->Request.CDB[6]);

or possibly:

put_unaligned(cpu_to_be16(creq->nr_sectors), &c->Request.CDB[8]);

would look less surprising than the current 16-bit in 24-bit thing and the 
"sect >> 24" comment there seems to imply the first?

(the implcit downcasting in that case is fine, right?)

Rene.

View attachment "cciss.diff" of type "text/plain" (3029 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ