projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
99c8bc5
)
io_uring: limit fixed table size by RLIMIT_NOFILE
author
Pavel Begunkov
<asml.silence@gmail.com>
Fri, 20 Aug 2021 09:36:35 +0000
(10:36 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 23 Aug 2021 19:10:46 +0000
(13:10 -0600)
Limit the number of files in io_uring fixed tables by RLIMIT_NOFILE,
that's the first and the simpliest restriction that we should impose.
Cc: stable@vger.kernel.org
Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/b2756c340aed7d6c0b302c26dab50c6c5907f4ce.1629451684.git.asml.silence@gmail.com
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 706ac8c03b959e1f8520df907dca0ee41be8c19d..9a021fe6c461392b715402c0bd22be18b1928a7e 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-7733,6
+7733,8
@@
static int io_sqe_files_register(struct io_ring_ctx *ctx, void __user *arg,
return -EINVAL;
if (nr_args > IORING_MAX_FIXED_FILES)
return -EMFILE;
+ if (nr_args > rlimit(RLIMIT_NOFILE))
+ return -EMFILE;
ret = io_rsrc_node_switch_start(ctx);
if (ret)
return ret;