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-22' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
"Just two small fixes - one fixing a potential leak for the iovec for
larger requests added in this cycle, and one fixing a theoretical leak
with CQE_SKIP and IOPOLL"

* tag 'io_uring-5.18-2022-04-22' of git://git.kernel.dk/linux-block:
io_uring: fix leaks on IOPOLL and CQE_SKIP
io_uring: free iovec if file assignment fails

+7 -4
+7 -4
fs/io_uring.c
··· 2797 2797 /* order with io_complete_rw_iopoll(), e.g. ->result updates */ 2798 2798 if (!smp_load_acquire(&req->iopoll_completed)) 2799 2799 break; 2800 + nr_events++; 2800 2801 if (unlikely(req->flags & REQ_F_CQE_SKIP)) 2801 2802 continue; 2802 - 2803 2803 __io_fill_cqe_req(req, req->result, io_put_kbuf(req, 0)); 2804 - nr_events++; 2805 2804 } 2806 2805 2807 2806 if (unlikely(!nr_events)) ··· 3831 3832 iovec = NULL; 3832 3833 } 3833 3834 ret = io_rw_init_file(req, FMODE_READ); 3834 - if (unlikely(ret)) 3835 + if (unlikely(ret)) { 3836 + kfree(iovec); 3835 3837 return ret; 3838 + } 3836 3839 req->result = iov_iter_count(&s->iter); 3837 3840 3838 3841 if (force_nonblock) { ··· 3959 3958 iovec = NULL; 3960 3959 } 3961 3960 ret = io_rw_init_file(req, FMODE_WRITE); 3962 - if (unlikely(ret)) 3961 + if (unlikely(ret)) { 3962 + kfree(iovec); 3963 3963 return ret; 3964 + } 3964 3965 req->result = iov_iter_count(&s->iter); 3965 3966 3966 3967 if (force_nonblock) {