io_uring takes a non-refcounted reference to the files_struct of the process that submitted a request (relying on ->flush() for being notified before the files_struct can go away). Unfortunately, unshare_fd(), which is used by bprm_execve() via unshare_files(), doesn't know about that, and assumes that if the files_struct's refcount is 1, it is okay to keep using the old files_struct. Therefore, an attacker can cause io_uring to fiddle around in the file descriptor table of a privileged process, and in particular steal file descriptors using IORING_OP_FILES_UPDATE.
Created kernel tracking bugs for this issue:
Affects: fedora-all [bug 1905498]
This was fixed for Fedora with the 5.8.18 stable kernel updates.