Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'io_uring-5.18-2022-04-29' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
"Pretty boring:

- three patches just adding reserved field checks (me, Eugene)

- Fixing a potential regression with IOPOLL caused by a block change
(Joseph)"

Boring is good.

* tag 'io_uring-5.18-2022-04-29' of git://git.kernel.dk/linux-block:
io_uring: check that data field is 0 in ringfd unregister
io_uring: fix uninitialized field in rw io_kiocb
io_uring: check reserved fields for recv/recvmsg
io_uring: check reserved fields for send/sendmsg

+6 -1
+6 -1
fs/io_uring.c
··· 3783 3783 if (!(kiocb->ki_flags & IOCB_DIRECT) || !file->f_op->iopoll) 3784 3784 return -EOPNOTSUPP; 3785 3785 3786 + kiocb->private = NULL; 3786 3787 kiocb->ki_flags |= IOCB_HIPRI | IOCB_ALLOC_CACHE; 3787 3788 kiocb->ki_complete = io_complete_rw_iopoll; 3788 3789 req->iopoll_completed = 0; ··· 5208 5207 5209 5208 if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) 5210 5209 return -EINVAL; 5210 + if (unlikely(sqe->addr2 || sqe->file_index)) 5211 + return -EINVAL; 5211 5212 5212 5213 sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); 5213 5214 sr->len = READ_ONCE(sqe->len); ··· 5420 5417 struct io_sr_msg *sr = &req->sr_msg; 5421 5418 5422 5419 if (unlikely(req->ctx->flags & IORING_SETUP_IOPOLL)) 5420 + return -EINVAL; 5421 + if (unlikely(sqe->addr2 || sqe->file_index)) 5423 5422 return -EINVAL; 5424 5423 5425 5424 sr->umsg = u64_to_user_ptr(READ_ONCE(sqe->addr)); ··· 10593 10588 ret = -EFAULT; 10594 10589 break; 10595 10590 } 10596 - if (reg.resv || reg.offset >= IO_RINGFD_REG_MAX) { 10591 + if (reg.resv || reg.data || reg.offset >= IO_RINGFD_REG_MAX) { 10597 10592 ret = -EINVAL; 10598 10593 break; 10599 10594 }