No description
Find a file
Li Jinlin eea03dcc24 fsdax: Fix infinite loop in dax_iomap_rw()
[ Upstream commit 17d9c15c9b ]

I got an infinite loop and a WARNING report when executing a tail command
in virtiofs.

  WARNING: CPU: 10 PID: 964 at fs/iomap/iter.c:34 iomap_iter+0x3a2/0x3d0
  Modules linked in:
  CPU: 10 PID: 964 Comm: tail Not tainted 5.19.0-rc7
  Call Trace:
  <TASK>
  dax_iomap_rw+0xea/0x620
  ? __this_cpu_preempt_check+0x13/0x20
  fuse_dax_read_iter+0x47/0x80
  fuse_file_read_iter+0xae/0xd0
  new_sync_read+0xfe/0x180
  ? 0xffffffff81000000
  vfs_read+0x14d/0x1a0
  ksys_read+0x6d/0xf0
  __x64_sys_read+0x1a/0x20
  do_syscall_64+0x3b/0x90
  entry_SYSCALL_64_after_hwframe+0x63/0xcd

The tail command will call read() with a count of 0. In this case,
iomap_iter() will report this WARNING, and always return 1 which casuing
the infinite loop in dax_iomap_rw().

Fixing by checking count whether is 0 in dax_iomap_rw().

Fixes: ca289e0b95 ("fsdax: switch dax_iomap_rw to use iomap_iter")
Signed-off-by: Li Jinlin <lijinlin3@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Link: https://lore.kernel.org/r/20220725032050.3873372-1-lijinlin3@huawei.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-19 17:54:06 +08:00
arch KVM: x86/mmu: Fold rmap_recycle into rmap_add 2023-04-19 17:54:05 +08:00
block block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait 2023-04-19 17:53:54 +08:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2023-04-19 17:50:34 +08:00
crypto KEYS: asymmetric: enforce SM2 signature use pkey algo 2023-04-19 17:52:55 +08:00
Documentation Input: iforce - add support for Boeder Force Feedback Wheel 2023-04-19 17:53:52 +08:00
drivers drm/rockchip: Fix return type of cdn_dp_connector_mode_valid 2023-04-19 17:54:06 +08:00
fs fsdax: Fix infinite loop in dax_iomap_rw() 2023-04-19 17:54:06 +08:00
include serial: Create uart_xmit_advance() 2023-04-19 17:54:05 +08:00
init stack: Declare {randomize_,}kstack_offset to fix Sparse warnings 2023-04-19 17:52:12 +08:00
ipc ipc/mqueue: use get_tree_nodev() in mqueue_get_tree() 2023-04-19 17:49:52 +08:00
kernel cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all() 2023-04-19 17:53:56 +08:00
lib crypto: lib - remove unneeded selection of XOR_BLOCKS 2023-04-19 17:53:28 +08:00
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes" 2021-07-15 06:31:24 -06:00
mm mm: slub: fix flush_cpu_slab()/__free_slab() invocations in task context. 2023-04-19 17:54:00 +08:00
net net: sched: fix possible refcount leak in tc_new_tfilter() 2023-04-19 17:54:05 +08:00
samples samples/landlock: Format with clang-format 2023-04-19 17:50:01 +08:00
scripts mksysmap: Fix the mismatch of 'L0' symbols in System.map 2023-04-19 17:53:56 +08:00
security apparmor: Fix memleak in aa_simple_write_to_buffer() 2023-04-19 17:53:01 +08:00
sound ALSA: hda/realtek: Enable 4-speaker output Dell Precision 5530 laptop 2023-04-19 17:53:59 +08:00
tools selftests: forwarding: add shebang for sch_red.sh 2023-04-19 17:54:05 +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: SEV: add cache flush to solve SEV cache incoherency issues 2023-04-19 17:53:56 +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 Input: goodix - add a goodix.h header file 2023-04-19 17:50:59 +08:00
Makefile Linux 5.15.70 2023-04-19 17:53:56 +08: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.