projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebedb25
)
io_uring: limit fixed table size by RLIMIT_NOFILE
author
Pavel Begunkov
<asml.silence@gmail.com>
Mon, 13 Sep 2021 15:35:35 +0000
(09:35 -0600)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:40:05 +0000
(13:40 +0200)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io_uring.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index 2009d1cda606c0e3d1591e60d37b170beca313bd..0db463599b00fcb0c2d385067566169426211b96 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-7579,6
+7579,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;
file_data = kzalloc(sizeof(*ctx->file_data), GFP_KERNEL);
if (!file_data)