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-6.3-2023-04-06' of git://git.kernel.dk/linux

Pull io_uring fixes from Jens Axboe:
"Just two minor fixes for provided buffers - one where we could
potentially leak a buffer, and one where the returned values was
off-by-one in some cases"

* tag 'io_uring-6.3-2023-04-06' of git://git.kernel.dk/linux:
io_uring: fix memory leak when removing provided buffers
io_uring: fix return value when removing provided buffers

+5 -4
+1 -1
io_uring/io_uring.c
··· 2789 2789 io_eventfd_unregister(ctx); 2790 2790 io_alloc_cache_free(&ctx->apoll_cache, io_apoll_cache_free); 2791 2791 io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free); 2792 - mutex_unlock(&ctx->uring_lock); 2793 2792 io_destroy_buffers(ctx); 2793 + mutex_unlock(&ctx->uring_lock); 2794 2794 if (ctx->sq_creds) 2795 2795 put_cred(ctx->sq_creds); 2796 2796 if (ctx->submitter_task)
+4 -3
io_uring/kbuf.c
··· 228 228 return i; 229 229 } 230 230 231 - /* the head kbuf is the list itself */ 231 + /* protects io_buffers_cache */ 232 + lockdep_assert_held(&ctx->uring_lock); 233 + 232 234 while (!list_empty(&bl->buf_list)) { 233 235 struct io_buffer *nxt; 234 236 235 237 nxt = list_first_entry(&bl->buf_list, struct io_buffer, list); 236 - list_del(&nxt->list); 238 + list_move(&nxt->list, &ctx->io_buffers_cache); 237 239 if (++i == nbufs) 238 240 return i; 239 241 cond_resched(); 240 242 } 241 - i++; 242 243 243 244 return i; 244 245 }