diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2015-07-15 10:55:37 +0300 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-07-23 22:53:05 -0700 |
commit | f5a8b3a796db01b639435515b3adc003b9f27387 (patch) | |
tree | 3ff4e026ec2af94cbef2cef9d365a5faf141059c /drivers/ata | |
parent | 12306b425d0dbab7b60f54e02d67cf3dfae494d1 (diff) | |
download | linux-f5a8b3a796db01b639435515b3adc003b9f27387.tar.gz linux-f5a8b3a796db01b639435515b3adc003b9f27387.tar.bz2 linux-f5a8b3a796db01b639435515b3adc003b9f27387.zip |
scsi: Protect against buffer possible overflow in scsi_set_sense_information
Make sure that the input sense buffer has sufficient length
to fit the information descriptor (12 additional bytes).
Modify scsi_set_sense_information to receive the sense buffer
length and adjust its callers scsi target and libata.
(Fix patch fuzz in scsi_set_sense_information - nab)
Reported-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Tejun Heo <tj@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/libata-scsi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 3131adcc1f87..2fb7c79e727f 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -289,7 +289,9 @@ void ata_scsi_set_sense_information(struct scsi_cmnd *cmd, return; information = ata_tf_read_block(tf, NULL); - scsi_set_sense_information(cmd->sense_buffer, information); + scsi_set_sense_information(cmd->sense_buffer, + SCSI_SENSE_BUFFERSIZE, + information); } static ssize_t |