Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737AbdG0InT (ORCPT ); Thu, 27 Jul 2017 04:43:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:54579 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751676AbdG0InM (ORCPT ); Thu, 27 Jul 2017 04:43:12 -0400 Subject: Re: [PATCH] scsi: sg: only check for dxfer_len greater than 256M To: Johannes Thumshirn , "Martin K . Petersen" Cc: Jason L Tibbitts III , Doug Gilbert , Linux Kernel Mailinglist , Linux SCSI Mailinglist , stable@vger.kernel.org References: <20170727071126.4717-1-jthumshirn@suse.de> From: Hannes Reinecke Message-ID: <4d4d2fa1-a603-a097-95ac-59e98cba795a@suse.de> Date: Thu, 27 Jul 2017 10:43:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170727071126.4717-1-jthumshirn@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1094 Lines: 29 On 07/27/2017 09:11 AM, Johannes Thumshirn wrote: > Don't make any assumptions on the sg_io_hdr_t::dxfer_direction or the > sg_io_hdr_t::dxferp in order to determine if it is a valid request. The > only way we can check for bad requests is by checking if the length exceeds > 256M. > > Signed-off-by: Johannes Thumshirn > Fixes: 28676d869bbb (scsi: sg: check for valid direction before starting the > request) > Reported-by: Jason L Tibbitts III > Tested-by: Jason L Tibbitts III > Suggested-by: Doug Gilbert > Cc: Doug Gilbert > Cc: > --- > drivers/scsi/sg.c | 31 +------------------------------ > 1 file changed, 1 insertion(+), 30 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@suse.de +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton HRB 21284 (AG Nürnberg)