]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
block: don't revert iter for -EIOCBQUEUED
authorJens Axboe <axboe@kernel.dk>
Thu, 23 Jan 2025 13:18:41 +0000 (06:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:49:45 +0000 (13:49 +0100)
commit6c26619effb1b4cb7d20b4e666ab8f71f6a53ccb
tree169fdd3c0d4b019b5806e2e4483fa738fbb0f6c6
parentb0dd4a661c6151c3bcc9ba654b4dbcb38a5b943c
block: don't revert iter for -EIOCBQUEUED

commit b13ee668e8280ca5b07f8ce2846b9957a8a10853 upstream.

blkdev_read_iter() has a few odd checks, like gating the position and
count adjustment on whether or not the result is bigger-than-or-equal to
zero (where bigger than makes more sense), and not checking the return
value of blkdev_direct_IO() before doing an iov_iter_revert(). The
latter can lead to attempting to revert with a negative value, which
when passed to iov_iter_revert() as an unsigned value will lead to
throwing a WARN_ON() because unroll is bigger than MAX_RW_COUNT.

Be sane and don't revert for -EIOCBQUEUED, like what is done in other
spots.

Cc: stable@vger.kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
block/fops.c