linux/io_uring
Kyumin Lee bc0e8faf90 io_uring: preserve task restrictions across exec
Per-task restrictions apply to all rings created by a task. Once
installed, they should not be dropped across exec.

For a task that has used io_uring, the exec cancellation path calls
__io_uring_free(). This frees both the task context and the per-task
restriction, so a ring created after exec is unrestricted.

Split task context cleanup into io_uring_free_tctx(), and use it from
the exec cancellation path. Keep __io_uring_free() for final task
cleanup, where both the context and restriction are released.

Fixes: ed82f35b92 ("io_uring: allow registration of per-task restrictions")
Cc: stable@vger.kernel.org # 7.1+
Signed-off-by: Kyumin Lee <fyonglkm@gmail.com>
Link: https://patch.msgid.link/20260730192734.459247-1-fyonglkm@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2026-07-30 14:40:22 -06:00
..
advise.c io_uring: finish IOU_OK -> IOU_COMPLETE transition 2025-05-21 08:41:16 -06:00
advise.h
alloc_cache.c
alloc_cache.h io_uring/rsrc: use kvfree() for the imu cache 2026-04-21 12:19:01 -06:00
bpf_filter.c Merge branch 'io_uring-7.0' into for-7.1/io_uring 2026-03-14 08:57:15 -06:00
bpf_filter.h io_uring: allow registration of per-task restrictions 2026-02-06 07:29:19 -07:00
bpf-ops.c io_uring/bpf-ops: reject re-registration of an already-bound ops 2026-07-17 11:17:54 -06:00
bpf-ops.h io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
cancel.c io_uring: preserve task restrictions across exec 2026-07-30 14:40:22 -06:00
cancel.h io_uring/cancel: de-unionize file and user_data in struct io_cancel_data 2026-02-16 14:16:27 -07:00
cmd_net.c io_uring/cmd_net: split ioctl code out of io_uring_cmd_sock() 2026-03-09 07:21:53 -06:00
epoll.c Revert "io_uring/epoll: disallow adding an epoll file to an epoll context" 2026-07-30 10:36:06 -06:00
epoll.h
eventfd.c io_uring/eventfd: reset deferred signal state 2026-05-03 23:21:40 -06:00
eventfd.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
fdinfo.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
fdinfo.h
filetable.c io_uring/filetable: clamp alloc_hint to the configured alloc range 2026-02-11 15:20:44 -07:00
filetable.h io_uring: Trim out unused includes 2026-01-05 17:08:20 -07:00
fs.c io_uring/fs: check unused sqe fields for unlinkat 2026-07-14 13:18:11 -06:00
fs.h
futex.c futex: Add support for unlocking robust futexes 2026-06-03 11:38:51 +02:00
futex.h
io_uring.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
io_uring.h io_uring/zcrx: notify user when out of buffers 2026-05-26 10:42:01 -06:00
io-wq.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
io-wq.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
kbuf.c io_uring/kbuf: cap buffer selection length at MAX_RW_COUNT 2026-07-30 10:33:05 -06:00
kbuf.h io_uring/kbuf: support min length left for incremental buffers 2026-04-28 16:08:56 -06:00
Kconfig io_uring/bpf-ops: implement loop_step with BPF struct_ops 2026-03-16 16:15:00 -06:00
loop.c io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
loop.h io_uring/bpf-ops: restrict ctx access to BPF 2026-06-02 11:20:21 -06:00
Makefile io_uring/bpf-ops: implement loop_step with BPF struct_ops 2026-03-16 16:15:00 -06:00
memmap.c io_uring/memmap: return -EINVAL from get_unmapped_area() on bad mmap 2026-07-01 05:37:07 -06:00
memmap.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
mock_file.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mpscq.h io_uring: get rid of tw_pending for !DEFER task work 2026-06-16 09:48:00 -06:00
msg_ring.c io_uring/msg_ring: reject CQE32 flag pass-through to normal rings 2026-07-01 05:39:26 -06:00
msg_ring.h
napi.c io_uring/napi: clear tracked NAPI entries on unregister 2026-05-03 23:21:23 -06:00
napi.h io_uring/napi: clear tracked NAPI entries on unregister 2026-05-03 23:21:23 -06:00
net.c io_uring/net: initialize mshot_len for send 2026-07-30 10:33:05 -06:00
net.h io_uring/net: allow filtering on IORING_OP_CONNECT 2026-05-14 07:23:01 -06:00
nop.c io_uring/nop: fix file reference leak with IOSQE_FIXED_FILE 2026-06-16 06:20:01 -06:00
nop.h
notif.c io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
notif.h
opdef.c io_uring, audit: don't log IORING_OP_RECV_ZC 2026-06-16 09:48:42 -06:00
opdef.h io_uring: remove iopoll_queue from struct io_issue_def 2026-03-16 16:14:14 -06:00
openclose.c io_uring/openclose: fix io_pipe_fixed() slot tracking for specific slots 2026-02-11 20:31:21 -07:00
openclose.h io_uring/bpf_filter: allow filtering on contents of struct open_how 2026-01-27 11:10:46 -07:00
poll.c io_uring/poll: ensure EPOLL_ONESHOT is propagated for EPOLL_URING_WAKE 2026-04-21 19:18:34 -06:00
poll.h io_uring: add wrapper type for io_req_tw_func_t arg 2025-11-03 08:31:26 -07:00
query.c io_uring/zcrx: rename notif to event 2026-07-22 09:48:42 -06:00
query.h io_uring/query: drop unused io_handle_query_entry() ctx arg 2025-11-26 09:37:10 -07:00
refs.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
register.c io_uring/register: preserve SQ array entries on resize 2026-06-16 10:06:49 -06:00
register.h io_uring: unify getting ctx from passed in file descriptor 2026-04-08 13:21:35 -06:00
rsrc.c for-7.2/block-20260615 2026-06-16 13:02:47 +05:30
rsrc.h io_uring/rsrc: bump struct io_mapped_ubuf length field to size_t 2026-05-14 08:12:23 -06:00
rw.c io_uring/rw: fix missing ERESTARTSYS conversion in read paths 2026-07-22 07:36:25 -06:00
rw.h io_uring: add wrapper type for io_req_tw_func_t arg 2025-11-03 08:31:26 -07:00
slist.h io_uring: Add SPDX id lines to remaining source files 2026-02-04 07:23:45 -07:00
splice.c io_uring: don't include filetable.h in io_uring.h 2025-09-08 13:20:46 -06:00
splice.h
sqpoll.c io_uring: switch normal task_work to a mpscq 2026-06-13 06:27:11 -06:00
sqpoll.h io_uring/sqpoll: switch away from getrusage() for CPU accounting 2025-10-22 10:51:20 -06:00
statx.c allow incomplete imports of filenames 2026-01-13 15:18:07 -05:00
statx.h
sync.c io_uring/sync: validate passed in offset 2026-01-21 11:50:59 -07:00
sync.h
tctx.c io_uring: preserve task restrictions across exec 2026-07-30 14:40:22 -06:00
tctx.h io_uring: preserve task restrictions across exec 2026-07-30 14:40:22 -06:00
timeout.c io_uring/timeout: splice timed out link in timeout handler 2026-05-20 10:02:58 -06:00
timeout.h io_uring/timeout: migrate reqs from ts64 to ktime 2026-03-09 07:21:54 -06:00
truncate.c fs: pass on FTRUNCATE_* flags to do_truncate 2026-03-23 12:41:57 +01:00
truncate.h
tw.c Revert "io_uring: grab RCU read lock marking task run" 2026-07-09 11:43:07 -06:00
tw.h io_uring: remove the per-ctx fallback task_work machinery 2026-06-13 06:27:20 -06:00
uring_cmd.c io_uring/uring_cmd: fix uring_cmd.c comments 2026-07-02 14:15:19 -06:00
uring_cmd.h io_uring/cmd: remove struct io_uring_cmd_data 2025-07-18 12:34:56 -06:00
wait.c for-7.2/io_uring-20260615 2026-06-16 12:53:59 +05:30
wait.h io_uring: switch local task_work to a mpscq 2026-06-13 06:27:06 -06:00
waitid.c io_uring/waitid: clear waitid info before copying it to userspace 2026-05-16 12:58:21 -06:00
waitid.h
xattr.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
xattr.h
zcrx.c io_uring/zcrx: don't clear master_ctx from the import path 2026-07-30 13:18:06 -06:00
zcrx.h io_uring/zcrx: rename notif to event 2026-07-22 09:48:42 -06:00