Skip to content

Commit 6ad4bf6

Browse files
committed
Merge tag 'io_uring-5.10-2020-10-12' of git://git.kernel.dk/linux-block
Pull io_uring updates from Jens Axboe: - Add blkcg accounting for io-wq offload (Dennis) - A use-after-free fix for io-wq (Hillf) - Cancelation fixes and improvements - Use proper files_struct references for offload - Cleanup of io_uring_get_socket() since that can now go into our own header - SQPOLL fixes and cleanups, and support for sharing the thread - Improvement to how page accounting is done for registered buffers and huge pages, accounting the real pinned state - Series cleaning up the xarray code (Willy) - Various cleanups, refactoring, and improvements (Pavel) - Use raw spinlock for io-wq (Sebastian) - Add support for ring restrictions (Stefano) * tag 'io_uring-5.10-2020-10-12' of git://git.kernel.dk/linux-block: (62 commits) io_uring: keep a pointer ref_node in file_data io_uring: refactor *files_register()'s error paths io_uring: clean file_data access in files_register io_uring: don't delay io_init_req() error check io_uring: clean leftovers after splitting issue io_uring: remove timeout.list after hrtimer cancel io_uring: use a separate struct for timeout_remove io_uring: improve submit_state.ios_left accounting io_uring: simplify io_file_get() io_uring: kill extra check in fixed io_file_get() io_uring: clean up ->files grabbing io_uring: don't io_prep_async_work() linked reqs io_uring: Convert advanced XArray uses to the normal API io_uring: Fix XArray usage in io_uring_add_task_file io_uring: Fix use of XArray in __io_uring_files_cancel io_uring: fix break condition for __io_uring_register() waiting io_uring: no need to call xa_destroy() on empty xarray io_uring: batch account ->req_issue and task struct references io_uring: kill callback_head argument for io_req_task_work_add() io_uring: move req preps out of io_issue_sqe() ...
2 parents 3ad11d7 + b2e9685 commit 6ad4bf6

12 files changed

Lines changed: 1662 additions & 911 deletions

File tree

fs/exec.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
#include <linux/oom.h>
6363
#include <linux/compat.h>
6464
#include <linux/vmalloc.h>
65+
#include <linux/io_uring.h>
6566

6667
#include <linux/uaccess.h>
6768
#include <asm/mmu_context.h>
@@ -1895,6 +1896,11 @@ static int bprm_execve(struct linux_binprm *bprm,
18951896
struct files_struct *displaced;
18961897
int retval;
18971898

1899+
/*
1900+
* Cancel any io_uring activity across execve
1901+
*/
1902+
io_uring_task_cancel();
1903+
18981904
retval = unshare_files(&displaced);
18991905
if (retval)
19001906
return retval;

fs/file.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/rcupdate.h>
2222
#include <linux/close_range.h>
2323
#include <net/sock.h>
24+
#include <linux/io_uring.h>
2425

2526
unsigned int sysctl_nr_open __read_mostly = 1024*1024;
2627
unsigned int sysctl_nr_open_min = BITS_PER_LONG;
@@ -452,6 +453,7 @@ void exit_files(struct task_struct *tsk)
452453
struct files_struct * files = tsk->files;
453454

454455
if (files) {
456+
io_uring_files_cancel(files);
455457
task_lock(tsk);
456458
tsk->files = NULL;
457459
task_unlock(tsk);

0 commit comments

Comments
 (0)