From: Linus Torvalds Date: Mon, 6 Jun 2022 00:14:03 +0000 (-0700) Subject: Merge tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs X-Git-Url: https://repo.jachan.dev/J-linux.git/commitdiff_plain/6684cf42906ff5f44580e16a1f898e89c19aabd5 Merge tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull file descriptor fix from Al Viro: "Fix for breakage in #work.fd this window" * tag 'pull-work.fd-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fix the breakage in close_fd_get_file() calling conventions change --- 6684cf42906ff5f44580e16a1f898e89c19aabd5 diff --cc fs/io_uring.c index 86f9df56526b,33da5116cc38..3aab4182fd89 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@@ -6025,11 -5124,9 +6025,10 @@@ static int io_close(struct io_kiocb *re spin_unlock(&files->file_lock); goto err; } - file = fdt->fd[close->fd]; + file = rcu_dereference_protected(fdt->fd[close->fd], + lockdep_is_held(&files->file_lock)); if (!file || file->f_op == &io_uring_fops) { spin_unlock(&files->file_lock); - file = NULL; goto err; }