Skip to content

Commit 22634bc

Browse files
committed
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: 14a1143 ("io_uring: add support for IORING_OP_UNLINKAT") Cc: [email protected] Reported-by: Dmitry Kadashev <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent ed7eb25 commit 22634bc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/io_uring.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,6 +3514,10 @@ static int io_unlinkat_prep(struct io_kiocb *req,
35143514
struct io_unlink *un = &req->unlink;
35153515
const char __user *fname;
35163516

3517+
if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL))
3518+
return -EINVAL;
3519+
if (sqe->ioprio || sqe->off || sqe->len || sqe->buf_index)
3520+
return -EINVAL;
35173521
if (unlikely(req->flags & REQ_F_FIXED_FILE))
35183522
return -EBADF;
35193523

0 commit comments

Comments
 (0)