Pavel Begunkov 1e95081cb5 io_uring: fix deferred req iovec leak
After defer, a request will be prepared, that includes allocating iovec
if needed, and then submitted through io_wq_submit_work() but not custom
handler (e.g. io_rw_async()/io_sendrecv_async()). However, it'll leak
iovec, as it's in io-wq and the code goes as follows:

io_read() {
	if (!io_wq_current_is_worker())
		kfree(iovec);
}

Put all deallocation logic in io_{read,write,send,recv}(), which will
leave the memory, if going async with -EAGAIN.

It also fixes a leak after failed io_alloc_async_ctx() in
io_{recv,send}_msg().

Cc: stable@vger.kernel.org # 5.5
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-02-06 13:58:57 -07:00
2020-02-06 06:15:23 +00:00
2020-02-06 07:12:11 +00:00
2020-02-06 12:21:01 +00:00
2020-02-06 13:58:57 -07:00
2020-02-06 12:21:01 +00:00
2020-02-06 07:12:11 +00:00
2020-02-06 07:12:11 +00:00
2020-02-06 07:12:11 +00:00
2020-02-06 12:21:01 +00:00
2020-02-04 03:05:24 +00:00
2020-02-06 08:08:59 +00:00
2020-02-06 07:12:11 +00:00
2020-02-04 07:03:40 +00:00
2020-01-18 09:19:18 -05:00
2020-02-06 07:12:11 +00:00
2020-02-01 10:01:52 -08:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
No description provided
Readme 5.7 GiB
Languages
C 97.6%
Assembly 1%
Shell 0.5%
Python 0.3%
Makefile 0.3%