Commit ed7eb259 authored by Jens Axboe's avatar Jens Axboe

io_uring: add IOPOLL and reserved field checks to IORING_OP_RENAMEAT

We can't support IOPOLL with non-pollable request types, and we should
check for unused/reserved fields like we do for other request types.

Fixes: 80a261fd ("io_uring: add support for IORING_OP_RENAMEAT")
Cc: stable@vger.kernel.org
Reported-by: default avatarDmitry Kadashev <dkadashev@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 12dcb58a
...@@ -3463,6 +3463,10 @@ static int io_renameat_prep(struct io_kiocb *req, ...@@ -3463,6 +3463,10 @@ static int io_renameat_prep(struct io_kiocb *req,
struct io_rename *ren = &req->rename; struct io_rename *ren = &req->rename;
const char __user *oldf, *newf; const char __user *oldf, *newf;
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
return -EINVAL;
if (sqe->ioprio || sqe->buf_index)
return -EINVAL;
if (unlikely(req->flags & REQ_F_FIXED_FILE)) if (unlikely(req->flags & REQ_F_FIXED_FILE))
return -EBADF; return -EBADF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment