Skip to content

9pfs: hardening against export root escape (CVE-2026-93834)

Christian Schoenebeck qemu-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7hw/9pfs: local_open_nofollow(): abort on illegal FID path componentshw/9pfs/9p-local.c+68 -30 replies
2/7hw/9pfs: move struct LocalData into 9p-local.hhw/9pfs/9p-local.c hw/9pfs/9p-local.h+4 -40 replies
3/7meson: move 9pfs-util selection to toplevel meson filehw/9pfs/meson.build meson.build+12 -60 replies
4/7tests/unit: add forktest.h, a forked-child run-and-verify helperMAINTAINERS tests/unit/forktest.h+133 -00 replies
5/7tests/unit: add test-9p-internals.cMAINTAINERS tests/unit/meson.build tests/unit/test-9p-internals.c+220 -00 replies
6/7hw/9pfs: local: abort on corrupt V9fsPath objectshw/9pfs/9p-local.c hw/9pfs/9p-local.h+45 -00 replies
7/7tests/9p-internals: test 9p's local_path_sanity_check() functiontests/unit/test-9p-internals.c+73 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] 9pfs: hardening against export root escape (CVE-2026-93834)

CVE-2026-93834 (fixed by fe9e30899ff) allowed guests to escape from 9p server's export root. Due to that severe impact, it is therefore worth hardening the 9p server at relevant, affected code locations.

Core patches of this series are the following 2 patches:

- Patch 1 hardens local_open_nofollow(), the most vulnerable place in 9p server for this, as this function does the actual element-wise path walk and openat() calls. Key change of this patch is to longer trust the passed path. The path is instead copied right at the beginning of the function to retain an immutable string so that nobody could pull the rug under our feet while we are then validating the path string upon that immutable path string, and the function would now abort QEMU process on any illegal path, not expected at this point, as it means server state is already corrupted.

- Patch 6 adds a sanity check exactly at those locations in the 9p local backend, where a manipulated path would manifest into real filesystem action. This new sanity check verifies the V9fsPath object, and again aborts the QEMU process loudly in this case, for the same reason described above.

Furthermore this series adds a new 9p test suite tests/unit/test-9p-internals.c, which checks expected behaviour of specific 9p server internal functions.

Christian Schoenebeck (7):
hw/9pfs: local_open_nofollow(): abort on illegal FID path components hw/9pfs: move struct LocalData into 9p-local.h
meson: move 9pfs-util selection to toplevel meson file tests/unit: add forktest.h, a forked-child run-and-verify helper tests/unit: add test-9p-internals.c
hw/9pfs: local: abort on corrupt V9fsPath objects tests/9p-internals: test 9p's local_path_sanity_check() function

 MAINTAINERS                    |   2 +
 hw/9pfs/9p-local.c             | 117 +++++++++++++-
 hw/9pfs/9p-local.h             |   5 +
 hw/9pfs/meson.build            |   8 +-
 meson.build                    |  10 ++
 tests/unit/forktest.h          | 132 ++++++++++++++++
 tests/unit/meson.build         |  22 +++
 tests/unit/test-9p-internals.c | 270 +++++++++++++++++++++++++++++++++
 8 files changed, 554 insertions(+), 12 deletions(-)
 create mode 100644 tests/unit/forktest.h
 create mode 100644 tests/unit/test-9p-internals.c
Signature · 1 line
2.47.3