mbox series

[net-next,v4,0/7] vsock/test: Tests for memory leaks

Message ID 20241219-test-vsock-leaks-v4-0-a416e554d9d7@rbox.co (mailing list archive)
Headers show
Series vsock/test: Tests for memory leaks | expand

Message

Michal Luczaj Dec. 19, 2024, 9:49 a.m. UTC
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-v2-0-4e21bfcfc818@rbox.co/
[2] https://lore.kernel.org/netdev/CANn89i+oL+qoPmbbGvE_RT3_3OWgeck7cCPcTafeehKrQZ8kyw@mail.gmail.com/

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-f1a4dcef9228@rbox.co

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-55e1405742fc@rbox.co

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-c31e8c875797@rbox.co

---
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,