Re: out of range LBA using sg_raw

2017-03-08 Thread Martin K. Petersen
> "Kashyap" == Kashyap Desai writes: Kashyap, Kashyap> Agree on this point. I am planning to study all possible such Kashyap> sanity in driver for VD and not trying to fix one specific Kashyap> scenario as described here. Do you think fix in this area is

Re: out of range LBA using sg_raw

2017-03-08 Thread Martin K. Petersen
> "Kashyap" == Kashyap Desai writes: Kashyap, Kashyap> Agree on this point. I am planning to study all possible such Kashyap> sanity in driver for VD and not trying to fix one specific Kashyap> scenario as described here. Do you think fix in this area is Kashyap> good for kernel-stable as

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Wednesday, March 08, 2017 10:03 PM > To: Kashyap Desai > Cc: Christoph Hellwig; linux-kernel@vger.kernel.org; linux- > s...@vger.kernel.org > Subject: Re: out of r

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Martin K. Petersen [mailto:martin.peter...@oracle.com] > Sent: Wednesday, March 08, 2017 10:03 PM > To: Kashyap Desai > Cc: Christoph Hellwig; linux-kernel@vger.kernel.org; linux- > s...@vger.kernel.org > Subject: Re: out of r

Re: out of range LBA using sg_raw

2017-03-08 Thread Martin K. Petersen
> "Kashyap" == Kashyap Desai writes: Kashyap, Kashyap> I am just curious to know how badly we have to scrutinize each Kashyap> packet before sending to Fast Path as we are in IO path and Kashyap> recommend only important checks to be added. As Christoph pointed

Re: out of range LBA using sg_raw

2017-03-08 Thread Martin K. Petersen
> "Kashyap" == Kashyap Desai writes: Kashyap, Kashyap> I am just curious to know how badly we have to scrutinize each Kashyap> packet before sending to Fast Path as we are in IO path and Kashyap> recommend only important checks to be added. As Christoph pointed out, when the fast path is

Re: out of range LBA using sg_raw

2017-03-08 Thread Christoph Hellwig
On Wed, Mar 08, 2017 at 09:29:28PM +0530, Kashyap Desai wrote: > Thanks Chris. It is understood to have sanity in driver, but how critical > such checks where SG_IO type interface send pass-through request. ? > Are you suggesting as good to have sanity or very important as there may > be a

Re: out of range LBA using sg_raw

2017-03-08 Thread Christoph Hellwig
On Wed, Mar 08, 2017 at 09:29:28PM +0530, Kashyap Desai wrote: > Thanks Chris. It is understood to have sanity in driver, but how critical > such checks where SG_IO type interface send pass-through request. ? > Are you suggesting as good to have sanity or very important as there may > be a

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Wednesday, March 08, 2017 9:37 PM > To: Kashyap Desai > Cc: Christoph Hellwig; linux-kernel@vger.kernel.org; linux- > s...@vger.kernel.org > Subject: Re: out of range LBA using sg_r

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Wednesday, March 08, 2017 9:37 PM > To: Kashyap Desai > Cc: Christoph Hellwig; linux-kernel@vger.kernel.org; linux- > s...@vger.kernel.org > Subject: Re: out of range LBA using sg_r

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Bart Van Assche [mailto:bart.vanass...@sandisk.com] > Sent: Wednesday, March 08, 2017 9:35 PM > To: h...@infradead.org; kashyap.de...@broadcom.com > Cc: linux-s...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: out of rang

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Bart Van Assche [mailto:bart.vanass...@sandisk.com] > Sent: Wednesday, March 08, 2017 9:35 PM > To: h...@infradead.org; kashyap.de...@broadcom.com > Cc: linux-s...@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: out of rang

Re: out of range LBA using sg_raw

2017-03-08 Thread Bart Van Assche
On Wed, 2017-03-08 at 21:29 +0530, Kashyap Desai wrote: > Also one more fault I can generate using below sg_raw command - > > "sg_raw -r 32k /dev/sdx 28 00 01 4f ff ff 00 00 08 00" > > Provide more scsi data length compare to actual SG buffer. Do you suggest > such SG_IO interface vulnerability

Re: out of range LBA using sg_raw

2017-03-08 Thread Bart Van Assche
On Wed, 2017-03-08 at 21:29 +0530, Kashyap Desai wrote: > Also one more fault I can generate using below sg_raw command - > > "sg_raw -r 32k /dev/sdx 28 00 01 4f ff ff 00 00 08 00" > > Provide more scsi data length compare to actual SG buffer. Do you suggest > such SG_IO interface vulnerability

Re: out of range LBA using sg_raw

2017-03-08 Thread Christoph Hellwig
Hi Kashyap, for SG_IO passthrough requests we can't validate command validity for commands as the block layer treats them as opaque. The SCSI device implementation needs to handle incorrect parameter to be robust. For your fast path bypass the megaraid driver assumes part of the SCSI device

Re: out of range LBA using sg_raw

2017-03-08 Thread Christoph Hellwig
Hi Kashyap, for SG_IO passthrough requests we can't validate command validity for commands as the block layer treats them as opaque. The SCSI device implementation needs to handle incorrect parameter to be robust. For your fast path bypass the megaraid driver assumes part of the SCSI device

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Wednesday, March 08, 2017 8:41 PM > To: Kashyap Desai > Cc: linux-kernel@vger.kernel.org; linux-s...@vger.kernel.org > Subject: Re: out of range LBA using sg_raw > > Hi Kashyap, &

RE: out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
> -Original Message- > From: Christoph Hellwig [mailto:h...@infradead.org] > Sent: Wednesday, March 08, 2017 8:41 PM > To: Kashyap Desai > Cc: linux-kernel@vger.kernel.org; linux-s...@vger.kernel.org > Subject: Re: out of range LBA using sg_raw > > Hi Kashyap, &

out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
Hi - Need help to understand if below is something we should consider to be fixed in megaraid_sas driver or call as unreal exposure. I have created slice VD of size 10GB (raid 1) using 2 drives. Each Physical Drive size is 256GB. Last LBA of the VD and actual Physical disk associated with

out of range LBA using sg_raw

2017-03-08 Thread Kashyap Desai
Hi - Need help to understand if below is something we should consider to be fixed in megaraid_sas driver or call as unreal exposure. I have created slice VD of size 10GB (raid 1) using 2 drives. Each Physical Drive size is 256GB. Last LBA of the VD and actual Physical disk associated with