On 11/15/24 14:44, Jens Axboe wrote:
On 11/13/24 9:14 PM, Pavel Begunkov wrote:
+void io_free_region(struct io_ring_ctx *ctx, struct io_mapped_region *mr)
+{
+ if (mr->pages)
+ unpin_user_pages(mr->pages, mr->nr_pages);
+ if (mr->vmap_ptr)
+ vunmap(mr->vmap_ptr);
+ if (mr->nr_pages && ctx->user)
+ __io_unaccount_mem(ctx->user, mr->nr_pages);
+
+ memset(mr, 0, sizeof(*mr));
+}
This is missing a kvfree(mr->pages);
Indeed, I'll fix it.
FWIW, this is v1 instead of v2 (which also has the same problem).
--
Pavel Begunkov