Commit 58dfbc2
ublk: reject FETCH from non-userspace context
__ublk_fetch() sets io->task to current, which is later checked
against io_uring_cmd_get_task() in ublk_uring_cmd_cancel_fn().
With REQ_F_FORCE_ASYNC, the FETCH uring_cmd can be issued from
task work, which can be run from io_uring's fallback workqueue,
causing a task mismatch and triggering the WARN in cancel_fn.
Reject FETCH if current is not a real userspace task, and it is
reasonable for failing it in case of io_uring fallback.
Fixes: 3421c7f ("ublk: make sure io cmd handled in submitter task context")
Signed-off-by: Ming Lei <[email protected]>1 parent 5a9f7c7 commit 58dfbc2
1 file changed
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3251 | 3251 | | |
3252 | 3252 | | |
3253 | 3253 | | |
3254 | | - | |
3255 | | - | |
3256 | | - | |
| 3254 | + | |
3257 | 3255 | | |
3258 | | - | |
| 3256 | + | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
3259 | 3263 | | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
3260 | 3267 | | |
3261 | 3268 | | |
3262 | 3269 | | |
| |||
0 commit comments