WSL2-Linux-Kernel/block
Linus Torvalds ac2111753c blk-mq: initialize 'struct request' and associated data to zero
Jan Engelhardt reports a strange oops with an invalid ->sense_buffer
pointer in scsi_init_cmd_errh() with the blk-mq code.

The sense_buffer pointer should have been initialized by the call to
scsi_init_request() from blk_mq_init_rq_map(), but there seems to be
some non-repeatable memory corruptor.

This patch makes sure we initialize the whole struct request allocation
(and the associated 'struct scsi_cmnd' for the SCSI case) to zero, by
using __GFP_ZERO in the allocation.  The old code initialized a couple
of individual fields, leaving the rest undefined (although many of them
are then initialized in later phases, like blk_mq_rq_ctx_init() etc.

It's not entirely clear why this matters, but it's the rigth thing to do
regardless, and with 4.0 imminent this is the defensive "let's just make
sure everything is initialized properly" patch.

Tested-by: Jan Engelhardt <jengelh@inai.de>
Acked-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-04-11 13:42:16 -07:00
..
partitions Merge branch 'for-3.20/core' of git://git.kernel.dk/linux-block 2015-02-12 14:13:23 -08:00
Kconfig
Kconfig.iosched
Makefile
bio-integrity.c
bio.c block: rewrite and split __bio_copy_iov() 2015-02-05 09:30:44 -07:00
blk-cgroup.c
blk-cgroup.h
blk-core.c Merge branch 'for-3.20/core' of git://git.kernel.dk/linux-block 2015-02-12 14:13:23 -08:00
blk-exec.c
blk-flush.c
blk-integrity.c
blk-ioc.c
blk-iopoll.c
blk-lib.c block: Quiesce zeroout wrapper 2015-02-05 10:14:54 -07:00
blk-map.c block: handle the null_mapped flag correctly in blk_rq_map_user_iov 2015-02-11 11:24:12 -07:00
blk-merge.c Fix bug in blk_rq_merge_ok 2015-03-20 08:50:41 -06:00
blk-mq-cpu.c
blk-mq-cpumap.c blk-mq: Use all available hardware queues 2014-12-09 09:08:21 -07:00
blk-mq-sysfs.c Revert "blk-mq: fix hctx/ctx kobject use-after-free" 2015-01-29 08:30:49 -08:00
blk-mq-tag.c blkmq: Fix NULL pointer deref when all reserved tags in 2015-03-18 17:06:18 -06:00
blk-mq-tag.h blk-mq: add tag allocation policy 2015-01-23 14:18:00 -07:00
blk-mq.c blk-mq: initialize 'struct request' and associated data to zero 2015-04-11 13:42:16 -07:00
blk-mq.h blk-mq: release mq's kobjects in blk_release_queue() 2015-01-29 08:30:51 -08:00
blk-settings.c block: fix blk_stack_limits() regression due to lcm() change 2015-03-31 09:45:50 -06:00
blk-softirq.c
blk-sysfs.c blk-mq: release mq's kobjects in blk_release_queue() 2015-01-29 08:30:51 -08:00
blk-tag.c block: support different tag allocation policy 2015-01-23 14:15:46 -07:00
blk-throttle.c blk-throttle: check stats_cpu before reading it from sysfs 2015-02-20 22:11:58 -08:00
blk-timeout.c blk-mq: Allow requests to never expire 2015-01-08 08:59:01 -07:00
blk.h
bounce.c
bsg-lib.c
bsg.c block: Simplify bsg complete all 2015-02-04 09:57:52 -07:00
cfq-iosched.c cfq-iosched: handle failure of cfq group allocation 2015-02-09 10:22:39 -07:00
cmdline-parser.c
compat_ioctl.c
deadline-iosched.c
elevator.c
genhd.c
ioctl.c block: Add discard flag to blkdev_issue_zeroout() function 2015-01-21 10:41:46 -07:00
ioprio.c
noop-iosched.c
partition-generic.c
scsi_ioctl.c block: pass iov_iter to the BLOCK_PC mapping functions 2015-02-05 09:30:40 -07:00
t10-pi.c