Go to file
Bart Van Assche 1dc7d74fe4 fs/aio: Restrict kiocb_set_cancel_fn() to I/O submitted via libaio
commit b820de741a upstream.

If kiocb_set_cancel_fn() is called for I/O submitted via io_uring, the
following kernel warning appears:

WARNING: CPU: 3 PID: 368 at fs/aio.c:598 kiocb_set_cancel_fn+0x9c/0xa8
Call trace:
 kiocb_set_cancel_fn+0x9c/0xa8
 ffs_epfile_read_iter+0x144/0x1d0
 io_read+0x19c/0x498
 io_issue_sqe+0x118/0x27c
 io_submit_sqes+0x25c/0x5fc
 __arm64_sys_io_uring_enter+0x104/0xab0
 invoke_syscall+0x58/0x11c
 el0_svc_common+0xb4/0xf4
 do_el0_svc+0x2c/0xb0
 el0_svc+0x2c/0xa4
 el0t_64_sync_handler+0x68/0xb4
 el0t_64_sync+0x1a4/0x1a8

Fix this by setting the IOCB_AIO_RW flag for read and write I/O that is
submitted by libaio.

Suggested-by: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Avi Kivity <avi@scylladb.com>
Cc: Sandeep Dhavale <dhavale@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: stable@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240215204739.2677806-2-bvanassche@acm.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:41:46 +01:00
arch LoongArch: Update cpu_sibling_map when disabling nonboot CPUs 2024-03-01 13:41:45 +01:00
block block: Fix WARNING in _copy_from_iter 2024-03-01 13:41:35 +01:00
certs This update includes the following changes: 2023-11-02 16:15:30 -10:00
crypto crypto: algif_hash - Remove bogus SGL free on zero-length error path 2024-02-23 09:51:51 +01:00
Documentation docs: Instruct LaTeX to cope with deeper nesting 2024-03-01 13:41:44 +01:00
drivers ata: libata-core: Do not call ata_dev_power_set_standby() twice 2024-03-01 13:41:45 +01:00
fs fs/aio: Restrict kiocb_set_cancel_fn() to I/O submitted via libaio 2024-03-01 13:41:46 +01:00
include fs/aio: Restrict kiocb_set_cancel_fn() to I/O submitted via libaio 2024-03-01 13:41:46 +01:00
init update workarounds for gcc "asm goto" issue 2024-02-23 09:51:21 +01:00
io_uring io_uring/net: fix multishot accept overflow handling 2024-02-23 09:51:50 +01:00
ipc Many singleton patches against the MM code. The patch series which are 2023-11-02 19:38:47 -10:00
kernel sched/membarrier: reduce the ability to hammer on sys_membarrier 2024-02-23 09:51:59 +01:00
lib kunit: Add a macro to wrap a deferred action function 2024-03-01 13:41:44 +01:00
LICENSES LICENSES: Add the copyleft-next-0.3.1 license 2022-11-08 15:44:01 +01:00
mm blk-wbt: Fix detection of dirty-throttled tasks 2024-02-23 09:51:56 +01:00
net mptcp: corner case locking for rx path fields initialization 2024-03-01 13:41:44 +01:00
rust rust: Ignore preserve-most functions 2024-01-25 15:45:09 -08:00
samples work around gcc bugs with 'asm goto' with outputs 2024-02-23 09:51:20 +01:00
scripts modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS 2024-02-23 09:51:39 +01:00
security lsm: fix the logic in security_inode_getsecctx() 2024-02-23 09:51:37 +01:00
sound ALSA: usb-audio: Ignore clock selector errors for single connection 2024-03-01 13:41:38 +01:00
tools tools: selftests: riscv: Fix compile warnings in mm tests 2024-03-01 13:41:34 +01:00
usr arch: Remove Itanium (IA-64) architecture 2023-09-11 08:13:17 +00:00
virt KVM/arm64 fixes for 6.7, part #2 2023-12-22 18:03:54 -05:00
.clang-format iommu: Add for_each_group_device() 2023-05-23 08:15:51 +02:00
.cocciconfig
.get_maintainer.ignore get_maintainer: add Alan to .get_maintainer.ignore 2022-08-20 15:17:44 -07:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore kbuild: rpm-pkg: generate kernel.spec in rpmbuild/SPECS/ 2023-10-03 20:49:09 +09:00
.mailmap 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING COPYING: state that all contributions really are covered by this file 2020-02-10 13:32:20 -08:00
CREDITS 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig kbuild: ensure full rebuild when the compiler is updated 2020-05-12 13:28:33 +09:00
MAINTAINERS 12 hotfixes. 2 are cc:stable and the remainder either address post-6.7 2024-01-05 13:46:18 -08:00
Makefile Linux 6.7.6 2024-02-23 09:51:59 +01:00
README Drop all 00-INDEX files from Documentation/ 2018-09-09 15:08:58 -06:00

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.