No description
Find a file
Bart Van Assche c01bd5916b block: Fix handling of offline queues in blk_mq_alloc_request_hctx()
[ Upstream commit 14dc7a18ab ]

This patch prevents that test nvme/004 triggers the following:

UBSAN: array-index-out-of-bounds in block/blk-mq.h:135:9
index 512 is out of range for type 'long unsigned int [512]'
Call Trace:
 show_stack+0x52/0x58
 dump_stack_lvl+0x49/0x5e
 dump_stack+0x10/0x12
 ubsan_epilogue+0x9/0x3b
 __ubsan_handle_out_of_bounds.cold+0x44/0x49
 blk_mq_alloc_request_hctx+0x304/0x310
 __nvme_submit_sync_cmd+0x70/0x200 [nvme_core]
 nvmf_connect_io_queue+0x23e/0x2a0 [nvme_fabrics]
 nvme_loop_connect_io_queues+0x8d/0xb0 [nvme_loop]
 nvme_loop_create_ctrl+0x58e/0x7d0 [nvme_loop]
 nvmf_create_ctrl+0x1d7/0x4d0 [nvme_fabrics]
 nvmf_dev_write+0xae/0x111 [nvme_fabrics]
 vfs_write+0x144/0x560
 ksys_write+0xb7/0x140
 __x64_sys_write+0x42/0x50
 do_syscall_64+0x35/0x80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Fixes: 20e4d81393 ("blk-mq: simplify queue mapping & schedule with each possisble CPU")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20220615210004.1031820-1-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-19 17:50:34 +08:00
arch arm64: ftrace: consistently handle PLTs. 2023-04-19 17:50:34 +08:00
block block: Fix handling of offline queues in blk_mq_alloc_request_hctx() 2023-04-19 17:50:34 +08:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2023-04-19 17:50:34 +08:00
crypto crypto: cryptd - Protect per-CPU resource by disabling BH. 2023-04-19 17:49:52 +08:00
Documentation x86/speculation/mmio: Add sysfs reporting for Processor MMIO Stale Data 2023-04-19 17:50:28 +08:00
drivers init: Initialize noop_backing_dev_info early 2023-04-19 17:50:34 +08:00
fs io_uring: fix races with buffer table unregister 2023-04-19 17:50:33 +08:00
include init: Initialize noop_backing_dev_info early 2023-04-19 17:50:34 +08:00
init Kconfig: Add option for asm goto w/ tied outputs to workaround clang-13 bug 2023-04-19 17:50:04 +08:00
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() 2023-04-19 17:49:52 +08:00
kernel dma-debug: make things less spammy under memory pressure 2023-04-19 17:50:29 +08:00
lib iov_iter: fix build issue due to possible type mis-match 2023-04-19 17:50:28 +08:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm init: Initialize noop_backing_dev_info early 2023-04-19 17:50:34 +08:00
net net: ax25: Fix deadlock caused by skb_recv_datagram in ax25_recvmsg 2023-04-19 17:50:34 +08:00
samples samples/landlock: Format with clang-format 2023-04-19 17:50:01 +08:00
scripts scripts/gdb: change kernel config dumping method 2023-04-19 17:50:25 +08:00
security KEYS: trusted: tpm2: Fix migratable logic 2023-04-19 17:50:26 +08:00
sound ALSA: hda/realtek - Add HW8326 support 2023-04-19 17:50:31 +08:00
tools KVM: x86/speculation: Disable Fill buffer clear within guests 2023-04-19 17:50:29 +08:00
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage 2023-04-19 17:44:58 +08:00
virt KVM: avoid NULL pointer dereference in kvm_dirty_ring_push 2023-04-19 17:47:52 +08:00
.clang-format clang-format: Update with the latest for_each macro list 2021-05-12 23:32:39 +02:00
.cocciconfig
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl 2019-05-16 10:53:40 -07:00
.gitattributes .gitattributes: use 'dts' diff driver for dts files 2019-12-04 19:44:11 -08:00
.gitignore .gitignore: ignore only top-level modules.builtin 2021-05-02 00:43:35 +09:00
.mailmap mailmap: add Andrej Shadura 2021-10-18 20:22:03 -10:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS MAINTAINERS: Move Daniel Drake to credits 2021-09-21 08:34:58 +03:00
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y 2020-02-04 01:53:07 +09:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS MAINTAINERS: add git tree for random.c 2023-04-19 17:49:03 +08:00
Makefile gcc-12: disable '-Wdangling-pointer' warning for now 2023-04-19 17:50:31 +08:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.