Skip to content
Snippets Groups Projects
Commit ca366fb1 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Frieder Schrempf
Browse files

lib/iov_iter: fix import_iovec_ubuf iovec management

commit f4b78260fc678ccd7169f32dc9f3bfa3b93931c7 upstream.

import_iovec() says that it should always be fine to kfree the iovec
returned in @iovp regardless of the error code.  __import_iovec_ubuf()
never reallocates it and thus should clear the pointer even in cases when
copy_iovec_*() fail.

Link: https://lkml.kernel.org/r/378ae26923ffc20fd5e41b4360d673bf47b1775b.1738332461.git.asml.silence@gmail.com


Fixes: 3b2deb0e ("iov_iter: import single vector iovecs as ITER_UBUF")
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Reviewed-by: default avatarJens Axboe <axboe@kernel.dk>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c346e3f7
No related branches found
No related tags found
1 merge request!192🤖 Sync Bot: Update v6.12-ktn to Latest Stable Kernel (v6.12.17)
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment