From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753679AbdCHP7d (ORCPT ); Wed, 8 Mar 2017 10:59:33 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:35232 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdCHP7b (ORCPT ); Wed, 8 Mar 2017 10:59:31 -0500 From: Kashyap Desai References: <20170308151113.GB27450@infradead.org> In-Reply-To: <20170308151113.GB27450@infradead.org> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHqyi2z261OWXWykCAwms8keM8sWgI2aaMXoUj90tA= Date: Wed, 8 Mar 2017 21:29:28 +0530 Message-ID: Subject: RE: out of range LBA using sg_raw To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Christoph Hellwig [mailto:hch@infradead.org] > Sent: Wednesday, March 08, 2017 8:41 PM > To: Kashyap Desai > Cc: linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org > Subject: Re: out of range LBA using sg_raw > > 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 > implementation, so it will have to check for validity. 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 real-time exposure other than SG_IO interface ? I am confused over must or good to have check. 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 is good to be captured in driver. I am just curious to know how badly we have to scrutinize each packet before sending to Fast Path as we are in IO path and recommend only important checks to be added. Thanks, Kashyap