]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: io_wq_submit_work() should not touch req->rw
authorJens Axboe <axboe@kernel.dk>
Wed, 18 Dec 2019 19:19:41 +0000 (12:19 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Dec 2019 19:19:41 +0000 (12:19 -0700)
commit21613019c33d4179605867fc61e3f079621a6f8e
tree7430a804ec01e1495d291353ad398b272e45d9cb
parent78940db119500bc1deda3c209155d9eaf3af0052
io_uring: io_wq_submit_work() should not touch req->rw

I've been chasing a weird and obscure crash that was userspace stack
corruption, and finally narrowed it down to a bit flip that made a
stack address invalid. io_wq_submit_work() unconditionally flips
the req->rw.ki_flags IOCB_NOWAIT bit, but since it's a generic work
handler, this isn't valid. Normal read/write operations own that
part of the request, on other types it could be something else.

Move the IOCB_NOWAIT clear to the read/write handlers where it belongs.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c