vsock/test: Tests for memory leaks
From: | Michal Luczaj <mhal-AT-rbox.co> | |
To: | Stefano Garzarella <sgarzare-AT-redhat.com> | |
Subject: | [PATCH net-next v4 0/7] vsock/test: Tests for memory leaks | |
Date: | Thu, 19 Dec 2024 10:49:27 +0100 | |
Message-ID: | <20241219-test-vsock-leaks-v4-0-a416e554d9d7@rbox.co> | |
Cc: | netdev-AT-vger.kernel.org, Michal Luczaj <mhal-AT-rbox.co>, Luigi Leonardi <leonardi-AT-redhat.com> | |
Archive-link: | Article |
Series adds tests for recently fixed memory leaks[1]: commit d7b0ff5a8667 ("virtio/vsock: Fix accept_queue memory leak") commit fbf7085b3ad1 ("vsock: Fix sk_error_queue memory leak") commit 60cf6206a1f5 ("virtio/vsock: Improve MSG_ZEROCOPY error handling") Patch 1 is a non-functional preparatory cleanup. Patch 2 is a test suite extension for picking specific tests. Patch 3 explains the need of kmemleak scans. Patch 4 adapts utility functions to handle MSG_ZEROCOPY. Patches 5-6-7 add the tests. NOTE: Test in the last patch ("vsock/test: Add test for MSG_ZEROCOPY completion memory leak") may stop working even before this series is merged. See changes proposed in [2]. The failslab variant would be unaffected. [1] https://lore.kernel.org/netdev/20241107-vsock-mem-leaks-v... [2] https://lore.kernel.org/netdev/CANn89i+oL+qoPmbbGvE_RT3_3... Signed-off-by: Michal Luczaj <mhal@rbox.co> --- Changes in v4, nothing functional: - Fix typo and cover letter - Collect R-b (Stefano) - Link to v3: https://lore.kernel.org/r/20241218-test-vsock-leaks-v3-0-... Changes in v3: - Allow for multiple tests selection (Stefano) - Generalize CONTINUE/DONE control messages (Stefano) - Collect R-b (Stefano) - Link to v2: https://lore.kernel.org/r/20241216-test-vsock-leaks-v2-0-... Changes in v2: - Introduce a vsock_test option to run a single test - ZC completion test: rewrite, comment, describe failslab approach (Stefano) - accept_queue test: rewrite, comment (Stefano) - Annotate functions and commits about the need of kmemleak (Stefano) - Add README section about kmemleak (Stefano) - Collect R-b (Luigi, Stefano) - Link to v1: https://lore.kernel.org/r/20241206-test-vsock-leaks-v1-0-... --- Michal Luczaj (7): vsock/test: Use NSEC_PER_SEC vsock/test: Introduce option to select tests vsock/test: Add README blurb about kmemleak usage vsock/test: Adapt send_byte()/recv_byte() to handle MSG_ZEROCOPY vsock/test: Add test for accept_queue memory leak vsock/test: Add test for sk_error_queue memory leak vsock/test: Add test for MSG_ZEROCOPY completion memory leak tools/testing/vsock/README | 15 +++ tools/testing/vsock/util.c | 33 ++++- tools/testing/vsock/util.h | 2 + tools/testing/vsock/vsock_test.c | 265 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 309 insertions(+), 6 deletions(-) --- base-commit: 2c2b61d2138f472e50b5531ec0cb4a1485837e21 change-id: 20241203-test-vsock-leaks-38f9559f5636 Best regards, -- Michal Luczaj <mhal@rbox.co>