Commit 697a528
committed
io_uring: fix IOPOLL with passthrough I/O
A previous commit improving IOPOLL made an incorrect assumption that
task_work isn't used with IOPOLL. This can cause crashes when doing
passthrough I/O on nvme, where queueing the completion task_work will
trample on the same memory that holds the completed list of requests.
Fix it up by shuffling the members around, so we're not sharing any
parts that end up getting used in this path.
Fixes: 3c7d76d ("io_uring: IOPOLL polling improvements")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Link: https://lore.kernel.org/linux-block/CAHj4cs_SLPj9v9w5MgfzHKy+983enPx3ZQY2kMuMJ1202DBefw@mail.gmail.com/
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Cc: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent d6406c4 commit 697a528
2 files changed
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | 716 | | |
721 | 717 | | |
722 | | - | |
| 718 | + | |
| 719 | + | |
723 | 720 | | |
724 | 721 | | |
725 | 722 | | |
| |||
728 | 725 | | |
729 | 726 | | |
730 | 727 | | |
731 | | - | |
732 | | - | |
| 728 | + | |
| 729 | + | |
733 | 730 | | |
734 | 731 | | |
735 | 732 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
1299 | | - | |
| 1299 | + | |
1300 | 1300 | | |
1301 | 1301 | | |
| 1302 | + | |
1302 | 1303 | | |
1303 | 1304 | | |
1304 | | - | |
| 1305 | + | |
1305 | 1306 | | |
1306 | 1307 | | |
1307 | 1308 | | |
| |||
0 commit comments