diff options
| author | Christian A. Ehrhardt <lk@c--e.de> | 2026-03-26 22:49:03 +0100 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-04-02 23:36:23 -0700 |
| commit | 0b49c7d0ae697fcecd7377cb7dda220f7cd096ff (patch) | |
| tree | 4c8aedf7c57d11827a26f6827f16fa8eca88d41f /rust/kernel/interop/git@git.tavy.me:linux-stable.git | |
| parent | 118cf3f55975352ac357fb194405031458186819 (diff) | |
lib: kunit_iov_iter: fix memory leaks
Use vfree() instead of vunmap() to free the buffer allocated by
iov_kunit_create_buffer() because vunmap() does not honour
VM_MAP_PUT_PAGES. In order for this to work the page array itself must
not be managed by kunit.
Remove the folio_put() when destroying a folioq. This is handled by
vfree(), now.
Pointed out by sashiko.dev on a previous iteration of this series.
Tested by running the kunit test 10000 times in a loop.
Link: https://lkml.kernel.org/r/20260326214905.818170-4-lk@c--e.de
Fixes: 2d71340ff1d4 ("iov_iter: Kunit tests for copying to/from an iterator")
Signed-off-by: Christian A. Ehrhardt <lk@c--e.de>
Cc: David Howells <dhowells@redhat.com>
Cc: David Gow <davidgow@google.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'rust/kernel/interop/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions
