mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-12 16:15:05 -04:00
Merge tag 'io_uring-6.10-20240530' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe:
"A couple of minor fixes for issues introduced in the 6.10 merge window:
- Ensure that all read/write ops have an appropriate cleanup handler
set (Breno)
- Regression for applications still doing multiple mmaps even if
FEAT_SINGLE_MMAP is set (me)
- Move kmsg inquiry setting above any potential failure point,
avoiding a spurious NONEMPTY flag setting on early error (me)"
* tag 'io_uring-6.10-20240530' of git://git.kernel.dk/linux:
io_uring/net: assign kmsg inq/flags before buffer selection
io_uring/rw: Free iovec before cleaning async data
io_uring: don't attempt to mmap larger than what the user asks for
This commit is contained in:
@@ -244,6 +244,7 @@ __cold int io_uring_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
struct io_ring_ctx *ctx = file->private_data;
|
||||
size_t sz = vma->vm_end - vma->vm_start;
|
||||
long offset = vma->vm_pgoff << PAGE_SHIFT;
|
||||
unsigned int npages;
|
||||
void *ptr;
|
||||
|
||||
ptr = io_uring_validate_mmap_request(file, vma->vm_pgoff, sz);
|
||||
@@ -253,8 +254,8 @@ __cold int io_uring_mmap(struct file *file, struct vm_area_struct *vma)
|
||||
switch (offset & IORING_OFF_MMAP_MASK) {
|
||||
case IORING_OFF_SQ_RING:
|
||||
case IORING_OFF_CQ_RING:
|
||||
return io_uring_mmap_pages(ctx, vma, ctx->ring_pages,
|
||||
ctx->n_ring_pages);
|
||||
npages = min(ctx->n_ring_pages, (sz + PAGE_SIZE - 1) >> PAGE_SHIFT);
|
||||
return io_uring_mmap_pages(ctx, vma, ctx->ring_pages, npages);
|
||||
case IORING_OFF_SQES:
|
||||
return io_uring_mmap_pages(ctx, vma, ctx->sqe_pages,
|
||||
ctx->n_sqe_pages);
|
||||
|
||||
@@ -1127,6 +1127,9 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags)
|
||||
flags |= MSG_DONTWAIT;
|
||||
|
||||
retry_multishot:
|
||||
kmsg->msg.msg_inq = -1;
|
||||
kmsg->msg.msg_flags = 0;
|
||||
|
||||
if (io_do_buffer_select(req)) {
|
||||
ret = io_recv_buf_select(req, kmsg, &len, issue_flags);
|
||||
if (unlikely(ret))
|
||||
@@ -1134,9 +1137,6 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags)
|
||||
sr->buf = NULL;
|
||||
}
|
||||
|
||||
kmsg->msg.msg_inq = -1;
|
||||
kmsg->msg.msg_flags = 0;
|
||||
|
||||
if (flags & MSG_WAITALL)
|
||||
min_ret = iov_iter_count(&kmsg->msg.msg_iter);
|
||||
|
||||
|
||||
@@ -516,10 +516,12 @@ const struct io_cold_def io_cold_defs[] = {
|
||||
},
|
||||
[IORING_OP_READ_FIXED] = {
|
||||
.name = "READ_FIXED",
|
||||
.cleanup = io_readv_writev_cleanup,
|
||||
.fail = io_rw_fail,
|
||||
},
|
||||
[IORING_OP_WRITE_FIXED] = {
|
||||
.name = "WRITE_FIXED",
|
||||
.cleanup = io_readv_writev_cleanup,
|
||||
.fail = io_rw_fail,
|
||||
},
|
||||
[IORING_OP_POLL_ADD] = {
|
||||
@@ -582,10 +584,12 @@ const struct io_cold_def io_cold_defs[] = {
|
||||
},
|
||||
[IORING_OP_READ] = {
|
||||
.name = "READ",
|
||||
.cleanup = io_readv_writev_cleanup,
|
||||
.fail = io_rw_fail,
|
||||
},
|
||||
[IORING_OP_WRITE] = {
|
||||
.name = "WRITE",
|
||||
.cleanup = io_readv_writev_cleanup,
|
||||
.fail = io_rw_fail,
|
||||
},
|
||||
[IORING_OP_FADVISE] = {
|
||||
@@ -692,6 +696,7 @@ const struct io_cold_def io_cold_defs[] = {
|
||||
},
|
||||
[IORING_OP_READ_MULTISHOT] = {
|
||||
.name = "READ_MULTISHOT",
|
||||
.cleanup = io_readv_writev_cleanup,
|
||||
},
|
||||
[IORING_OP_WAITID] = {
|
||||
.name = "WAITID",
|
||||
|
||||
Reference in New Issue
Block a user