Skip to content

Commit

Permalink
exec: Move io_uring_task_cancel after the point of no return
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Eric W. Biederman <[email protected]>
  • Loading branch information
ebiederm committed Dec 10, 2020
1 parent c39ab6d commit 9ee1206
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9ee1206

Please sign in to comment.