Commit e0b245f
io_uring: hold 'ctx' reference around task_work queue + execute
fix #29820404
commit 6d816e0 linux-block/io_uring-5.9
branch.
We're holding the request reference, but we need to go one higher
to ensure that the ctx remains valid after the request has finished.
If the ring is closed with pending task_work inflight, and the
given io_kiocb finishes sync during issue, then we need a reference
to the ring itself around the task_work execution cycle.
Cc: stable@vger.kernel.org # v5.7+
Reported-by: syzbot+9b260fc33297966f5a8e@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Jiufei Xue <jiufei.xue@linux.alibaba.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>1 parent 329479e commit e0b245f
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4089 | 4089 | | |
4090 | 4090 | | |
4091 | 4091 | | |
| 4092 | + | |
4092 | 4093 | | |
4093 | 4094 | | |
4094 | 4095 | | |
| |||
4174 | 4175 | | |
4175 | 4176 | | |
4176 | 4177 | | |
| 4178 | + | |
4177 | 4179 | | |
4178 | 4180 | | |
4179 | 4181 | | |
| |||
4184 | 4186 | | |
4185 | 4187 | | |
4186 | 4188 | | |
| 4189 | + | |
4187 | 4190 | | |
4188 | 4191 | | |
4189 | 4192 | | |
| |||
4298 | 4301 | | |
4299 | 4302 | | |
4300 | 4303 | | |
| 4304 | + | |
4301 | 4305 | | |
4302 | 4306 | | |
4303 | 4307 | | |
| |||
4336 | 4340 | | |
4337 | 4341 | | |
4338 | 4342 | | |
| 4343 | + | |
4339 | 4344 | | |
4340 | 4345 | | |
4341 | 4346 | | |
| |||
0 commit comments