io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] iter revert problems
@ 2021-08-23 10:18 Pavel Begunkov
  2021-08-23 10:18 ` [PATCH v3 1/2] iov_iter: track truncated size Pavel Begunkov
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Pavel Begunkov @ 2021-08-23 10:18 UTC (permalink / raw)
  To: Jens Axboe, io-uring, Alexander Viro, linux-fsdevel
  Cc: Palash Oswal, Sudip Mukherjee, linux-kernel,
	syzbot+9671693590ef5aad8953, asml.silence

iov_iter_revert() doesn't go well with iov_iter_truncate() in all
cases, see 2/2 for the bug description. As mentioned there the current
problems is because of generic_write_checks(), but there was also a
similar case fixed in 5.12, which should have been triggerable by normal
write(2)/read(2) and others.

It may be better to enforce reexpands as a long term solution, but for
now this patchset is quickier and easier to backport.

v2: don't fail if it was justly fully reverted
v3: use truncated size + reexapand based approach

Pavel Begunkov (2):
  iov_iter: track truncated size
  io_uring: reexpand under-reexpanded iters

 fs/io_uring.c       | 2 ++
 include/linux/uio.h | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-09-04  0:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-23 10:18 [PATCH v3 0/2] iter revert problems Pavel Begunkov
2021-08-23 10:18 ` [PATCH v3 1/2] iov_iter: track truncated size Pavel Begunkov
2021-08-23 10:18 ` [PATCH v3 2/2] io_uring: reexpand under-reexpanded iters Pavel Begunkov
2021-08-23 16:14 ` [PATCH v3 0/2] iter revert problems Jens Axboe
2021-09-03 20:55 ` Jens Axboe
2021-09-03 21:55   ` Al Viro
2021-09-04  0:57     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).