Patch "scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND" has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND

to the 3.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     scsi-fix-error-handling-in-scsi_ioctl_send_command.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 84ce0f0e94ac97217398b3b69c21c7a62ebeed05 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@xxxxxxx>
Date: Wed, 22 Oct 2014 20:13:39 -0600
Subject: scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND

From: Jan Kara <jack@xxxxxxx>

commit 84ce0f0e94ac97217398b3b69c21c7a62ebeed05 upstream.

When sg_scsi_ioctl() fails to prepare request to submit in
blk_rq_map_kern() we jump to a label where we just end up copying
(luckily zeroed-out) kernel buffer to userspace instead of reporting
error. Fix the problem by jumping to the right label.

CC: Jens Axboe <axboe@xxxxxxxxx>
CC: linux-scsi@xxxxxxxxxxxxxxx
Coverity-id: 1226871
Signed-off-by: Jan Kara <jack@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Fixed up the, now unused, out label.

Signed-off-by: Jens Axboe <axboe@xxxxxx>

---
 block/scsi_ioctl.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -506,7 +506,7 @@ int sg_scsi_ioctl(struct request_queue *
 
 	if (bytes && blk_rq_map_kern(q, rq, buffer, bytes, __GFP_WAIT)) {
 		err = DRIVER_ERROR << 24;
-		goto out;
+		goto error;
 	}
 
 	memset(sense, 0, sizeof(sense));
@@ -516,7 +516,6 @@ int sg_scsi_ioctl(struct request_queue *
 
 	blk_execute_rq(q, disk, rq, 0);
 
-out:
 	err = rq->errors & 0xff;	/* only 8 bit SCSI status */
 	if (err) {
 		if (rq->sense_len && rq->sense) {


Patches currently in stable-queue which might be from jack@xxxxxxx are

queue-3.10/evm-check-xattr-value-length-and-type-in-evm_inode_setxattr.patch
queue-3.10/scsi-fix-error-handling-in-scsi_ioctl_send_command.patch
queue-3.10/ext4-don-t-check-quota-format-when-there-are-no-quota-files.patch
queue-3.10/lib-bitmap.c-fix-undefined-shift-in-__bitmap_shift_-left-right.patch
queue-3.10/ext4-fix-oops-when-loading-block-bitmap-failed.patch
queue-3.10/vfs-fix-data-corruption-when-blocksize-pagesize-for-mmaped-data.patch
queue-3.10/ext4-fix-overflow-when-updating-superblock-backups-after-resize.patch
queue-3.10/ext4-grab-missed-write_count-for-ext4_ioc_swap_boot.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]