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:
d8a3ba9
)
io_uring: verify resv is 0 in ringfd register/unregister
author
Dylan Yudaken
<dylany@fb.com>
Tue, 12 Apr 2022 16:30:41 +0000
(09:30 -0700)
committer
Jens Axboe
<axboe@kernel.dk>
Tue, 12 Apr 2022 16:46:54 +0000
(10:46 -0600)
Only allow resv field to be 0 in struct io_uring_rsrc_update user
arguments.
Fixes:
e7a6c00dc77a
("io_uring: add support for registering ring file descriptors")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link:
https://lore.kernel.org/r/20220412163042.2788062-4-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index e899192ffb77d2b845fc58cd6dc39d72acf8e8c5..a84bfec97d0def0a0531d30af022f9fabd3fa169 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-10533,6
+10533,11
@@
static int io_ringfd_register(struct io_ring_ctx *ctx, void __user *__arg,
break;
}
+ if (reg.resv) {
+ ret = -EINVAL;
+ break;
+ }
+
if (reg.offset == -1U) {
start = 0;
end = IO_RINGFD_REG_MAX;
@@
-10579,7
+10584,7
@@
static int io_ringfd_unregister(struct io_ring_ctx *ctx, void __user *__arg,
ret = -EFAULT;
break;
}
- if (reg.offset >= IO_RINGFD_REG_MAX) {
+ if (reg.
resv || reg.
offset >= IO_RINGFD_REG_MAX) {
ret = -EINVAL;
break;
}