linux-stable/block
Jan Kara b5f10e9885 scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND
commit 84ce0f0e94 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@kernel.dk>
CC: linux-scsi@vger.kernel.org
Coverity-id: 1226871
Signed-off-by: Jan Kara <jack@suse.cz>

Fixed up the, now unused, out label.

Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
(cherry picked from commit d73b032b63)

Signed-off-by: Willy Tarreau <w@1wt.eu>
2015-05-24 10:10:54 +02:00
..
as-iosched.c percpu: clean up percpu variable definitions 2009-06-24 15:13:48 +09:00
blk-barrier.c block: allow large discard requests 2009-10-01 21:19:34 +02:00
blk-core.c block: add missing blk_queue_dead() checks 2014-12-13 15:16:19 +01:00
blk-exec.c block: Fix blk_execute_rq_nowait() dead queue handling 2014-12-13 15:16:19 +01:00
blk-integrity.c block: fix improper kobject release in blk_integrity_unregister 2009-07-28 09:11:14 +02:00
blk-ioc.c block: Fix io_context leak after failure of clone with CLONE_IO 2012-10-07 23:37:22 +02:00
blk-iopoll.c block: use interrupts disabled version of raise_softirq_irqoff() 2009-09-11 14:33:32 +02:00
blk-map.c block: check for proper length of iov entries in blk_rq_map_user_iov() 2010-12-09 13:26:30 -08:00
blk-merge.c block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead 2011-01-07 14:43:18 -08:00
blk-settings.c block: Deprecate QUEUE_FLAG_CLUSTER and use queue_limits instead 2011-01-07 14:43:18 -08:00
blk-softirq.c generic-ipi: remove CSD_FLAG_WAIT 2009-02-25 14:13:44 +01:00
blk-sysfs.c block, blk-sysfs: Fix an err return path in blk_register_queue() 2011-05-09 15:54:46 -07:00
blk-tag.c block: use proper BLK_RW_ASYNC in blk_queue_start_tag() 2009-10-06 20:19:02 +02:00
blk-timeout.c block: ensure jiffies wrap is handled correctly in blk_rq_timed_out_timer 2010-05-12 14:57:05 -07:00
blk.h block: add proper state guards to __elv_next_request 2011-06-23 15:24:01 -07:00
bsg.c bsg: fix sysfs link remove warning 2012-03-17 11:14:48 +01:00
cfq-iosched.c cfq-iosched: fix cfq_cic_link() race confition 2012-01-06 15:38:00 -08:00
compat_ioctl.c block: Topology ioctls 2009-10-03 20:52:01 +02:00
deadline-iosched.c block: convert to pos and nr_sectors accessors 2009-05-11 09:50:54 +02:00
elevator.c elv_iosched_store(): fix strstrip() misuse 2009-10-09 08:48:08 +02:00
genhd.c block: Seperate read and write statistics of in_flight requests v2 2009-10-06 20:16:55 +02:00
ioctl.c block: Topology ioctls 2009-10-03 20:52:01 +02:00
Kconfig Make SCSI SG v4 driver enabled by default and remove EXPERIMENTAL dependency, since udev depends on BSG 2009-08-04 22:10:17 +02:00
Kconfig.iosched update I/O sched Kconfig help texts - CFQ is now default, not AS. 2007-02-17 20:08:22 +01:00
Makefile block: add blk-iopoll, a NAPI like approach for block devices 2009-09-11 14:33:31 +02:00
noop-iosched.c block: get rid of elevator_t typedef 2008-12-29 08:29:50 +01:00
scsi_ioctl.c scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND 2015-05-24 10:10:54 +02:00