projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dddb3e2
)
io_uring: validate the full range of provided buffers for access
author
Bijan Mottahedeh
<bijan.mottahedeh@oracle.com>
Fri, 5 Jun 2020 01:01:52 +0000
(18:01 -0700)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 8 Jun 2020 15:39:13 +0000
(09:39 -0600)
Account for the number of provided buffers when validating the address
range.
Signed-off-by: Bijan Mottahedeh <bijan.mottahedeh@oracle.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
70f0f2f
..
5431b18
100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-3183,7
+3183,7
@@
static int io_provide_buffers_prep(struct io_kiocb *req,
p->addr = READ_ONCE(sqe->addr);
p->len = READ_ONCE(sqe->len);
- if (!access_ok(u64_to_user_ptr(p->addr),
p->len
))
+ if (!access_ok(u64_to_user_ptr(p->addr),
(p->len * p->nbufs)
))
return -EFAULT;
p->bgid = READ_ONCE(sqe->buf_group);