linux-stable/block
Christian A. Ehrhardt 13f3956eb5 block: Fix WARNING in _copy_from_iter
Syzkaller reports a warning in _copy_from_iter because an
iov_iter is supposedly used in the wrong direction. The reason
is that syzcaller managed to generate a request with
a transfer direction of SG_DXFER_TO_FROM_DEV. This instructs
the kernel to copy user buffers into the kernel, read into
the copied buffers and then copy the data back to user space.

Thus the iovec is used in both directions.

Detect this situation in the block layer and construct a new
iterator with the correct direction for the copy-in.

Reported-by: syzbot+a532b03fdfee2c137666@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/lkml/0000000000009b92c10604d7a5e9@google.com/t/
Reported-by: syzbot+63dec323ac56c28e644f@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/lkml/0000000000003faaa105f6e7c658@google.com/T/
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240121202634.275068-1-lk@c--e.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-01-23 08:56:55 -07:00
..
partitions block: Move checking GENHD_FL_NO_PART to bdev_add_partition() 2024-01-22 09:51:29 -07:00
Kconfig block: Add config option to not allow writing to mounted devices 2023-11-18 14:59:25 +01:00
Kconfig.iosched
Makefile
badblocks.c badblocks: avoid checking invalid range in badblocks_check() 2023-12-23 18:38:08 -07:00
bdev.c vfs-6.8.super 2024-01-08 10:43:51 -08:00
bfq-cgroup.c
bfq-iosched.c
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c block: bio-integrity: fix kcalloc() arguments order 2024-01-16 09:51:22 -07:00
bio.c block: support adding less than len in bio_add_hw_page 2023-12-15 07:34:27 -07:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c block: Correct a documentation comment in blk-cgroup.c 2024-01-15 07:23:38 -07:00
blk-cgroup.h blk-cgroup: fix rcu lockdep warning in blkg_lookup() 2024-01-04 16:08:54 -07:00
blk-core.c for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
blk-crypto-fallback.c
blk-crypto-internal.h
blk-crypto-profile.c
blk-crypto-sysfs.c
blk-crypto.c
blk-flush.c
blk-ia-ranges.c
blk-integrity.c
blk-ioc.c
blk-iocost.c block/iocost: silence warning on 'last_period' potentially being unused 2024-01-10 08:43:06 -07:00
blk-iolatency.c
blk-ioprio.c
blk-ioprio.h
blk-lib.c
blk-map.c block: Fix WARNING in _copy_from_iter 2024-01-23 08:56:55 -07:00
blk-merge.c block: remove two comments in bio_split_discard 2023-12-29 08:44:12 -07:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c blk-mq: Remove the hctx 'run' debugfs attribute 2024-01-17 14:16:34 -07:00
blk-mq-debugfs.h
blk-mq-pci.c
blk-mq-sched.c blk-mq: Remove the hctx 'run' debugfs attribute 2024-01-17 14:16:34 -07:00
blk-mq-sched.h
blk-mq-sysfs.c
blk-mq-tag.c
blk-mq-virtio.c
blk-mq.c for-6.8/block-2024-01-18 2024-01-18 18:22:40 -08:00
blk-mq.h
blk-pm.c block: Remove blk_set_runtime_active() 2023-11-20 10:22:40 -07:00
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h block: skip QUEUE_FLAG_STATS and rq-qos for passthrough io 2023-12-01 18:29:18 -07:00
blk-settings.c block: floor the discard granularity to the physical block size 2024-01-04 16:05:49 -07:00
blk-stat.c
blk-stat.h
blk-sysfs.c for-6.8/block-2024-01-08 2024-01-11 13:58:04 -08:00
blk-throttle.c blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" 2023-11-17 10:48:58 -07:00
blk-throttle.h
blk-timeout.c
blk-wbt.c blk-wbt: remove the separate write cache tracking 2023-12-26 09:28:10 -07:00
blk-wbt.h blk-wbt: remove the separate write cache tracking 2023-12-26 09:28:10 -07:00
blk-zoned.c block: Treat sequential write preferred zone type as invalid 2024-01-08 08:34:24 -07:00
blk.h block: simplify disk_set_zoned 2023-12-19 20:17:43 -07:00
bounce.c
bsg-lib.c
bsg.c
disk-events.c
early-lookup.c
elevator.c
elevator.h
fops.c fs: convert block_write_full_page to block_write_full_folio 2023-12-29 11:58:35 -08:00
genhd.c block: add check of 'minors' and 'first_minor' in device_add_disk() 2023-12-19 08:23:12 -07:00
holder.c
ioctl.c block: Move checking GENHD_FL_NO_PART to bdev_add_partition() 2024-01-22 09:51:29 -07:00
ioprio.c block: move __get_task_ioprio() into header file 2024-01-08 12:27:39 -07:00
kyber-iosched.c
mq-deadline.c
opal_proto.h
sed-opal.c
t10-pi.c