Add iopoll/sqe field checks to unlink/rename
Subsystems (3)
Jens Axboe
maintainercover Add iopoll/sqe field checks to unlink/rename
Hi,
For some reason these were missed when added, ensure we get them added now. The IOPOLL is a correctness issue in that we cannot mix and match polled and waitable IO on the same context, the field checking is more of a sanity thing that allows us to more easily extend it in the future, if need be.
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerPATCH 1/2 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.
--- fs/io_uring.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/io_uring.c +4 -0
@@ -3453,6 +3453,10 @@ static int io_renameat_prep(struct io_kiocb *req,struct io_rename *ren = &req->rename;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 ))return -EBADF ;
Signature · 1 line
2.32.0
Jens Axboe
maintainerPATCH 2/2 io_uring: add IOPOLL and reserved field checks to IORING_OP_UNLINKAT
In reply to Jens AxboeWe can't support IOPOLL with non-pollable request types, and we should check for unused/reserved fields like we do for other request types.
--- fs/io_uring.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/io_uring.c +4 -0
@@ -3504,6 +3504,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 ;
Signature · 1 line
2.32.0