io_uring registered resources keep authority after the request ends

An I/O request usually carries its authority through ordinary process state: the caller has a file descriptor, a buffer, and a set of credentials. Linux io_uring changes that model by creating a submission queue that can prepare work for later execution. It also allows applications to register files, buffers, and credentials as reusable resources. Those registrations are useful, but each one creates authority that may outlive the call that created it.

io_uring_register(2) documents IORING_REGISTER_FILES, which registers a file set that operations can reference by fixed-file index. It also documents IORING_REGISTER_PERSONALITY, which registers the running application's credentials and returns an identifier. That identifier can be placed in the personality field of a submission queue entry. The manual page explicitly describes rings shared between separate users or processes as a use case.

Which identity runs the work

The kernel needs a rule for the credentials used by synchronous and asynchronous execution. io_uring_setup(2) describes IORING_FEAT_CUR_PERSONALITY. With that feature, both paths use the credentials of the task that called io_uring_enter(2) to queue the request. Without the feature, operations use the credentials of the task that originally registered the ring. A registered personality can override that choice for individual requests.

This is more than an implementation detail. If a privileged process creates a ring and passes its file descriptor to a less privileged component, the new component may be able to submit work against registered files and personalities that the original process prepared. A shared ring therefore behaves like a capability set. Treat access to the ring descriptor, shared memory mappings, fixed-file indexes, and personality identifiers as security-sensitive configuration.

Review the sharing model

Applications that do not need shared rings should keep them private to one trust domain. A supervisor that exposes a ring to another process should validate the queue entries it accepts and restrict which personalities and fixed files are available to that client. Do not assume the peer is allowed to use every object already registered with the ring.

Seccomp profiles and service sandboxes should list io_uring_setup, io_uring_enter, and io_uring_register deliberately. If the workload does not need the API, the kernel's io_uring_disabled control can remove the surface at a host or namespace boundary. If it does need the API, log ring creation, sharing, personality registration, and file registration in the controlling service rather than relying only on individual I/O requests.

Lifecycle tests should close or revoke a ring before handing its files or memory to an untrusted component, verify that closed fixed files cannot be reused, and check whether a shared ring can select a stale personality after a role change. Include worker-thread behavior in the test, because credential timing can differ between submission and completion.

Registered resources make io_uring efficient and make its authority persistent. The design review should name who can submit to the ring, which credentials each request may use, and which files remain reachable after the original request returns.

References