summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-06-23 09:07:45 -0600
committerJens Axboe <axboe@kernel.dk>2021-06-30 14:15:39 -0600
commit22634bc5620d29765e5199c7b230a372c7ddcda2 (patch)
treea466f7acfb186f4da5a64a8a93a246dcd9051712 /fs
parented7eb2592286ead7d3bfdf8adf65e65392167cc4 (diff)
downloadlinux-22634bc5620d29765e5199c7b230a372c7ddcda2.tar.bz2
io_uring: add IOPOLL and reserved field checks to IORING_OP_UNLINKAT
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: 14a1143b68ee ("io_uring: add support for IORING_OP_UNLINKAT") Cc: stable@vger.kernel.org Reported-by: Dmitry Kadashev <dkadashev@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r--fs/io_uring.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 02eda0575c56..a0bb3cc7d3bb 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3514,6 +3514,10 @@ static int io_unlinkat_prep(struct io_kiocb *req,
struct io_unlink *un = &req->unlink;
const char __user *fname;
+ if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
+ return -EINVAL;
+ if (sqe->ioprio || sqe->off || sqe->len || sqe->buf_index)
+ return -EINVAL;
if (unlikely(req->flags & REQ_F_FIXED_FILE))
return -EBADF;