From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v2 9/9] scsi: Check sense buffer size at build time Date: Wed, 1 Aug 2018 01:25:16 -0700 Message-ID: <20180801082516.GE26378@infradead.org> References: <20180731195155.46664-1-keescook@chromium.org> <20180731195155.46664-10-keescook@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180731195155.46664-10-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org To: Kees Cook Cc: Jens Axboe , Christoph Hellwig , "Martin K. Petersen" , "James E.J. Bottomley" , Tejun Heo , Borislav Petkov , "David S. Miller" , "Manoj N. Kumar" , "Matthew R. Ochs" , Uma Krishnan , "Nicholas A. Bellinger" , Thomas Gleixner , Philippe Ombredanne , Stephen Boyd , Cyrille Pitchen , Juergen Gross , Viresh Kumar , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= List-Id: linux-ide@vger.kernel.org On Tue, Jul 31, 2018 at 12:51:54PM -0700, Kees Cook wrote: > To avoid introducing problems like those fixed in commit f7068114d45e > ("sr: pass down correctly sized SCSI sense buffer"), this creates a macro > wrapper for scsi_execute() that verifies the size of the sense buffer > similar to what was done for command string sizes in commit 3756f6401c30 > ("exec: avoid gcc-8 warning for get_task_comm"). > > Another solution could be to add a length argument to scsi_execute(), > but this function already takes a lot of arguments and Jens was not fond > of that approach. > > Additionally, this moves the SCSI_SENSE_BUFFERSIZE definition into > scsi_device.h, and removes a redundant include for scsi_device.h from > scsi_cmnd.h. > > Signed-off-by: Kees Cook Looks good, Reviewed-by: Christoph Hellwig