mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
io_uring: Fix use-after-free in io_sq_wq_submit_work()
when ctx->sqo_mm is zero, io_sq_wq_submit_work() frees 'req' without deleting it from 'task_list'. After that, 'req' is accessed in io_ring_ctx_wait_and_kill() which lead to a use-after-free. Signed-off-by: Guoyu Huang <hgy5945@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a4d61e66ee
commit
e8053c6833
@@ -2232,6 +2232,7 @@ restart:
|
||||
if (io_req_needs_user(req) && !cur_mm) {
|
||||
if (!mmget_not_zero(ctx->sqo_mm)) {
|
||||
ret = -EFAULT;
|
||||
goto end_req;
|
||||
} else {
|
||||
cur_mm = ctx->sqo_mm;
|
||||
use_mm(cur_mm);
|
||||
|
||||
Reference in New Issue
Block a user