This is a note to let you know that I've just added the patch titled io_uring: get an active ref_node from files_data to the 5.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-get-an-active-ref_node-from-files_data.patch and it can be found in the queue-5.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 1e5d770bb8a23dd01e28e92f4fb0b1093c8bdbe6 Mon Sep 17 00:00:00 2001 From: Pavel Begunkov <asml.silence@xxxxxxxxx> Date: Wed, 18 Nov 2020 14:56:25 +0000 Subject: io_uring: get an active ref_node from files_data From: Pavel Begunkov <asml.silence@xxxxxxxxx> commit 1e5d770bb8a23dd01e28e92f4fb0b1093c8bdbe6 upstream. An active ref_node always can be found in ctx->files_data, it's much safer to get it this way instead of poking into files_data->ref_list. Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx # v5.7+ Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/io_uring.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6854,9 +6854,8 @@ static int io_sqe_files_unregister(struc return -ENXIO; spin_lock(&data->lock); - if (!list_empty(&data->ref_list)) - ref_node = list_first_entry(&data->ref_list, - struct fixed_file_ref_node, node); + ref_node = container_of(data->cur_refs, struct fixed_file_ref_node, + refs); spin_unlock(&data->lock); if (ref_node) percpu_ref_kill(&ref_node->refs); Patches currently in stable-queue which might be from asml.silence@xxxxxxxxx are queue-5.9/io_uring-get-an-active-ref_node-from-files_data.patch queue-5.9/io_uring-order-refnode-recycling.patch