summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-07-31 21:51:54 +0200
committerJens Axboe <axboe@kernel.dk>2018-08-02 23:23:51 +0200
commit704f83928c8e7da6e06144569efb15dec73278e8 (patch)
tree6603bc65758e0c761fc773b8341bf9875dc5fe76 /drivers/ata/libata-scsi.c
parentlibata-scsi: Move sense buffers onto stack (diff)
downloadlinux-704f83928c8e7da6e06144569efb15dec73278e8.tar.xz
linux-704f83928c8e7da6e06144569efb15dec73278e8.zip
scsi: Check sense buffer size at build time
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. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
0 files changed, 0 insertions, 0 deletions