diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2020-11-30 23:58:46 +0100 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2020-12-10 19:57:13 +0100 |
commit | 9ee1206dcfb9d56503c0de9f8320f7b29c795867 (patch) | |
tree | dabde07842e85d4eff0a8cd6302ca182ee96f748 /fs/exec.c | |
parent | coredump: Document coredump code exclusively used by cell spufs (diff) | |
download | linux-9ee1206dcfb9d56503c0de9f8320f7b29c795867.tar.xz linux-9ee1206dcfb9d56503c0de9f8320f7b29c795867.zip |
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.org
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/exec.c b/fs/exec.c index 48fa4fc1b116..9917ebcd0fe5 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -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; |