This series adds a race test suite for 9p and fixes a race on legacy
9p2000(.u)'s Tread request on directories, which was uncovered by this
new test suite.
This new race test suite challenges races by sending crafted concurrent 9p
requests on certain aspects of the 9p protocol. This series covers 3 race
tests:
1. Patch 2 adds "race/fid-path": this race test guards CVE-2026-93834
(fixed by commit fe9e30899f "hw/9pfs: Use read-write lock for protecting
fid path.").
Please refer to the commit log message of this patch for how to run
these new 9p race tests in general.
2. Patch 5 adds "race/readdir": this test guards directory stream races
on 9p2000.L's Treaddir request.
3. Patch 9 adds "race/tread-dir": this tests legacy 9p2000(.u)'s equivalent
of Treaddir for directory stream races, and this test got triggered during
the work on this series.
Therefore:
- Fix: Patch 6 fixes the directory stream race vulnerability uncovered by
race test #3.
All the other patches are basically just 9p test client additions required
for these new tests.
Changes:
v2:
- Allow skipping these race tests by setting environment variable
V9FS_RACE=0, or force running them by setting V9FS_RACE=1 respectively.
Christian Schoenebeck (9):
tests/9p-client: add Txattrwalk / Rxattrwalk test client functions
tests/9p-race: add 9p race test suite (race FID-path mutations)
tests/9p-client: add Rerror function (legacy 9p2000.u)
tests/9p-client: add Tstat / Rstat test client functions
tests/9p-race: add Treaddir race test
hw/9pfs: fix dirent stream protection for legacy (9p2000.u) Tread
tests/9p-client: add Tcreate / Rcreate test client functions
tests/9p-client: track the negotiated 9p version for session
tests/9p-race: add Tread-on-dir race test
MAINTAINERS | 1 +
hw/9pfs/9p.c | 23 +-
tests/qtest/libqos/virtio-9p-client.c | 213 ++++-
tests/qtest/libqos/virtio-9p-client.h | 124 +++
tests/qtest/libqos/virtio-9p.h | 6 +
tests/qtest/meson.build | 1 +
tests/qtest/virtio-9p-race-test.c | 1035 +++++++++++++++++++++++++
7 files changed, 1393 insertions(+), 10 deletions(-)
create mode 100644 tests/qtest/virtio-9p-race-test.c
--
2.47.3