projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a294bef
)
io_uring: use rcu_dereference in io_close
author
Christoph Hellwig
<hch@lst.de>
Wed, 18 May 2022 08:40:05 +0000
(10:40 +0200)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 18 May 2022 12:19:05 +0000
(06:19 -0600)
Accessing the file table needs a rcu_dereference_protected().
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link:
https://lore.kernel.org/r/20220518084005.3255380-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index e24eb20f7e30717f2eab6faf986e52c6c2aa01d2..7b27afdab0e65b106e380bcffedfabfbc354c253 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-5372,7
+5372,8
@@
static int io_close(struct io_kiocb *req, unsigned int issue_flags)
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;