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-Tag: baikal/mips/sdk6.1~5540 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f2b999b267cf4231b70d1f4298e0d84b9de9adc6;p=kernel.git 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 --- f2b999b267cf4231b70d1f4298e0d84b9de9adc6 diff --cc fs/io_uring.c index 86f9df56526b2,33da5116cc38c..3aab4182fd892 --- 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; }