Skip to content

vsock/test: check for null-ptr-deref when transport changes

Luigi Leonardi lkml netdev virtualization 5 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20250306-test_vsock-3e77a9c7a245

Versions newest first

  1. v5 Latest2 patches 2 repliesApplied 2/2
  2. v41 patch 2 repliesSuperseded
  3. v31 patch 2 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v21 patch6 repliesSuperseded
v12 patches2 repliesSuperseded

Changes in v5 from the cover letter

- Addressed Stefano's comments:
- Use a macro for G2H transport detection
- Improved commits and comments text
- Rebased on latest net-next
- Link to v4:
https://lore.kernel.org/r/[email protected]

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2vsock/test: Add macros to identify transportstools/testing/vsock/util.h+4 -01 replyApplied
2/2vsock/test: Add test for null ptr deref when transport changestools/testing/vsock/Makefile tools/testing/vsock/vsock_test.c+171 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchStefano Garzarella
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH net-next v5 0/2] vsock/test: check for null-ptr-deref when transport changes

This series introduces a new test that checks for a null pointer dereference that may happen when there is a transport change[1]. This bug was fixed in [2].

Note that this test *cannot* fail, it hangs if it triggers a kernel oops. The intended use-case is to run it and then check if there is any oops in the dmesg.

This test is based on Hyunwoo Kim's[3] and Michal's python reproducers[4].

[1]https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/ [2]https://lore.kernel.org/netdev/[email protected]/ [3]https://lore.kernel.org/netdev/Z2LvdTTQR7dBmPb5@v4bel-B760M-AORUS-ELITE-AX/#t [4]https://lore.kernel.org/netdev/[email protected]/

---
Changes in v5:
- Addressed Stefano's comments:
- Use a macro for G2H transport detection
- Improved commits and comments text
- Rebased on latest net-next
- Link to v4:
https://lore.kernel.org/r/[email protected]

Changes in v4:
- Addressed Stefano's comments:
- Minor style changes
- Use get_transports() to print a warning when a G2H transport is loaded
- Removed check on second connect: Because the first connect is interrupted, the socket is in an unspecified state (see man connect) . This can cause strange and unexpected behaviors (connect returning success on a non-existing CID).

- Link to v3:
https://lore.kernel.org/r/[email protected]

Sorry, this took waaay longer than expected.

Changes in v3:
Addressed Stefano's and Michal's comments:
- Added the splat text to the commit commessage.
- Introduced commit hash that fixes the bug.
- Not using perror anymore on pthread_* functions.
- Listener is just created once.

- Link to v2:
https://lore.kernel.org/r/[email protected]

Changes in v2:
- Addressed Stefano's comments:
- Timeout is now using current_nsec()
- Check for return values
- Style issues
- Added Hyunwoo Kim to Suggested-by
- Link to v1:
https://lore.kernel.org/r/[email protected]

---
Luigi Leonardi (2):
vsock/test: Add macros to identify transports vsock/test: Add test for null ptr deref when transport changes

 tools/testing/vsock/Makefile     |   1 +
 tools/testing/vsock/util.h       |   4 +
 tools/testing/vsock/vsock_test.c | 170 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 175 insertions(+)

---
base-commit: 647496422ba9d2784fb8e15b3fda7fe801b1f2ff
change-id: 20250306-test_vsock-3e77a9c7a245

Best regards,

Signature · 1 line
Luigi Leonardi <[email protected]>