summaryrefslogtreecommitdiff
path: root/drivers/memstick
diff options
context:
space:
mode:
authorChristian A. Ehrhardt <lk@c--e.de>2024-01-21 23:26:34 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-03-01 15:34:49 +0300
commit0f1bae071de9967602807472921829a54b2e5956 (patch)
treec554bab567973b46ee6262227eb10c4e69a6b22f /drivers/memstick
parentd637b5118274701e8448f35953877daf04df18b4 (diff)
downloadlinux-0f1bae071de9967602807472921829a54b2e5956.tar.xz
block: Fix WARNING in _copy_from_iter
[ Upstream commit 13f3956eb5681a4045a8dfdef48df5dc4d9f58a6 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/memstick')
0 files changed, 0 insertions, 0 deletions