mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 09:13:20 -05:00
io_uring-5.18-2022-04-22
-----BEGIN PGP SIGNATURE----- iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAmJjYJUQHGF4Ym9lQGtl cm5lbC5kawAKCRD301j7KXHgpsZZEADS/dD7pZKxBLcHTCGJAik1/IIv/3ynTrOp o86uV0AH+nL6lUyBU7uTTQVFn9Hjh6T10ZfRmcU+1Xb8G4obHTrQJkk5evwCNPng 9CUW2fwQa+6H4Ui8TU7f1rLcLlm+AUSVmab6h/20X5ldMwzF1JhcE11qtqZw0ti7 mDPwmxEsx7KMvMy59awA+5IpnXHxe5SvHXuzLsMNwux6dH7VauxE8R+Y+HHVzLWc fM2dbEU2Hq5nL23DedMw3ZaHwhQTiWdOQA0386iDB6cJdFv19iw+ApD4KS/qAT2X URQ3pmyNOXvOsBosVL4za7VVCoUlA23ZSMoU82p2K3NK4NGfV7S4oIeO5ZR2BK/C bIC4c2gutIbYrtdSITBW4z2tj+26BBZS7LaT3Bek/3BL+GjQuM6vK8N4ZhRXPC+l vWAwXUnWSyXR4+HWpvm3ewlrSY5CQjfsZgU1PIYybhTf/oo2BxX/HQfRk3XKfLIR 89gvITTUrC8B4dgPgLs/MF4Ercmoa2//2yL0onBEwdC2b1lRqD/bGM2FAYolzLzf W1+BrFj3sRUjexdO7ChrtZvAWo59REAxXdP/3h+NbkIz8sunG2Vpf9NX3cXj30n3 bZL3SkEbtFxpnXspRSQRnmL6DMLPMa7UC+MxpNBAV0g6aMmuSdxqiIZR10+kIEyR PJyRqbRefg== =Huq7 -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
1f5e98e723
1 changed files with 7 additions and 4 deletions
|
@ -2797,11 +2797,10 @@ static int io_do_iopoll(struct io_ring_ctx *ctx, bool force_nonspin)
|
|||
/* order with io_complete_rw_iopoll(), e.g. ->result updates */
|
||||
if (!smp_load_acquire(&req->iopoll_completed))
|
||||
break;
|
||||
nr_events++;
|
||||
if (unlikely(req->flags & REQ_F_CQE_SKIP))
|
||||
continue;
|
||||
|
||||
__io_fill_cqe_req(req, req->result, io_put_kbuf(req, 0));
|
||||
nr_events++;
|
||||
}
|
||||
|
||||
if (unlikely(!nr_events))
|
||||
|
@ -3832,8 +3831,10 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
|
|||
iovec = NULL;
|
||||
}
|
||||
ret = io_rw_init_file(req, FMODE_READ);
|
||||
if (unlikely(ret))
|
||||
if (unlikely(ret)) {
|
||||
kfree(iovec);
|
||||
return ret;
|
||||
}
|
||||
req->result = iov_iter_count(&s->iter);
|
||||
|
||||
if (force_nonblock) {
|
||||
|
@ -3958,8 +3959,10 @@ static int io_write(struct io_kiocb *req, unsigned int issue_flags)
|
|||
iovec = NULL;
|
||||
}
|
||||
ret = io_rw_init_file(req, FMODE_WRITE);
|
||||
if (unlikely(ret))
|
||||
if (unlikely(ret)) {
|
||||
kfree(iovec);
|
||||
return ret;
|
||||
}
|
||||
req->result = iov_iter_count(&s->iter);
|
||||
|
||||
if (force_nonblock) {
|
||||
|
|
Loading…
Add table
Reference in a new issue