projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4add705
)
io_uring: limit registration w/ SINGLE_ISSUER
author
Pavel Begunkov
<asml.silence@gmail.com>
Tue, 27 Sep 2022 00:13:30 +0000
(
01:13
+0100)
committer
Jens Axboe
<axboe@kernel.dk>
Fri, 7 Oct 2022 18:25:30 +0000
(12:25 -0600)
IORING_SETUP_SINGLE_ISSUER restricts what tasks can submit requests.
Extend it to registration as well, so non-owning task can't do
registrations. It's not necessary at the moment but might be useful in
the future.
Cc: <stable@vger.kernel.org> # 6.0
Fixes:
97bbdc06a444
("io_uring: add IORING_SETUP_SINGLE_ISSUER")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/f52a6a9c8a8990d4a831f73c0571e7406aac2bba.1664237592.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
patch
|
blob
|
blame
|
history
diff --git
a/io_uring/io_uring.c
b/io_uring/io_uring.c
index fe6ef64c873e050d58d8521b514de4b65ca858b3..63f6ce5e53551119de6177b5f7bc24c3dffffa6d 100644
(file)
--- a/
io_uring/io_uring.c
+++ b/
io_uring/io_uring.c
@@
-3890,6
+3890,9
@@
static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
if (WARN_ON_ONCE(percpu_ref_is_dying(&ctx->refs)))
return -ENXIO;
+ if (ctx->submitter_task && ctx->submitter_task != current)
+ return -EEXIST;
+
if (ctx->restricted) {
if (opcode >= IORING_REGISTER_LAST)
return -EINVAL;