mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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>
This commit is contained in:
parent
c39ab6de22
commit
9ee1206dcf
1 changed files with 5 additions and 5 deletions
10
fs/exec.c
10
fs/exec.c
|
@ -1257,6 +1257,11 @@ int begin_new_exec(struct linux_binprm * bprm)
|
||||||
if (retval)
|
if (retval)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Cancel any io_uring activity across execve
|
||||||
|
*/
|
||||||
|
io_uring_task_cancel();
|
||||||
|
|
||||||
/* Ensure the files table is not shared. */
|
/* Ensure the files table is not shared. */
|
||||||
retval = unshare_files();
|
retval = unshare_files();
|
||||||
if (retval)
|
if (retval)
|
||||||
|
@ -1783,11 +1788,6 @@ static int bprm_execve(struct linux_binprm *bprm,
|
||||||
struct file *file;
|
struct file *file;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
/*
|
|
||||||
* Cancel any io_uring activity across execve
|
|
||||||
*/
|
|
||||||
io_uring_task_cancel();
|
|
||||||
|
|
||||||
retval = prepare_bprm_creds(bprm);
|
retval = prepare_bprm_creds(bprm);
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
|
|
Loading…
Add table
Reference in a new issue