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:
b6c7db3
)
io_uring: validate timespec for timeout removals
author
Ye Bin
<yebin10@huawei.com>
Mon, 29 Nov 2021 04:15:37 +0000
(12:15 +0800)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 29 Nov 2021 13:46:39 +0000
(06:46 -0700)
Like commit
f6223ff79966
, timeout removal should also validate the
timespec that is being passed in.
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link:
https://lore.kernel.org/r/20211129041537.1936270-1-yebin10@huawei.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 08b1b3de9b3fb9d24a28e8763507abb41a47c5fc..8b6bfed16f65e7381183d6bbbda757e21c4278c5 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-6111,6
+6111,8
@@
static int io_timeout_remove_prep(struct io_kiocb *req,
return -EINVAL;
if (get_timespec64(&tr->ts, u64_to_user_ptr(sqe->addr2)))
return -EFAULT;
+ if (tr->ts.tv_sec < 0 || tr->ts.tv_nsec < 0)
+ return -EINVAL;
} else if (tr->flags) {
/* timeout removal doesn't support flags */
return -EINVAL;