提交 9ee1206d 编写于 作者: E Eric W. Biederman

exec: Move io_uring_task_cancel after the point of no return

Now that unshare_files happens in begin_new_exec after the point of no
return, io_uring_task_cancel can also happen later.

Effectively this means io_uring activities for a task are only canceled
when exec succeeds.

Link: https://lkml.kernel.org/r/878saih2op.fsf@x220.int.ebiederm.orgSigned-off-by: NEric W. Biederman <ebiederm@xmission.com>
上级 c39ab6de
......@@ -1257,6 +1257,11 @@ int begin_new_exec(struct linux_binprm * bprm)
if (retval)
goto out;
/*
* Cancel any io_uring activity across execve
*/
io_uring_task_cancel();
/* Ensure the files table is not shared. */
retval = unshare_files();
if (retval)
......@@ -1783,11 +1788,6 @@ static int bprm_execve(struct linux_binprm *bprm,
struct file *file;
int retval;
/*
* Cancel any io_uring activity across execve
*/
io_uring_task_cancel();
retval = prepare_bprm_creds(bprm);
if (retval)
return retval;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册