All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <groug@kaod.org>, Paolo Bonzini <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Subject: [PATCH 0/7] 9pfs: hardening against export root escape (CVE-2026-93834)
Date: Mon, 23 Nov 2026 16:31:09 +0100	[thread overview]
Message-ID: <cover.1795447869.git.qemu_oss@crudebyte.com> (raw)

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

-- 
2.47.3



             reply	other threads:[~2026-11-23 15:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 15:31 Christian Schoenebeck [this message]
2026-11-23 15:24 ` [PATCH 1/7] hw/9pfs: local_open_nofollow(): abort on illegal FID path components Christian Schoenebeck
2026-11-23 15:24 ` [PATCH 2/7] hw/9pfs: move struct LocalData into 9p-local.h Christian Schoenebeck
2026-11-23 15:24 ` [PATCH 3/7] meson: move 9pfs-util selection to toplevel meson file Christian Schoenebeck
2026-11-23 15:24 ` [PATCH 4/7] tests/unit: add forktest.h, a forked-child run-and-verify helper Christian Schoenebeck
2026-11-23 15:25 ` [PATCH 5/7] tests/unit: add test-9p-internals.c Christian Schoenebeck
2026-11-23 15:25 ` [PATCH 6/7] hw/9pfs: local: abort on corrupt V9fsPath objects Christian Schoenebeck
2026-11-23 15:25 ` [PATCH 7/7] tests/9p-internals: test 9p's local_path_sanity_check() function Christian Schoenebeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1795447869.git.qemu_oss@crudebyte.com \
    --to=qemu_oss@crudebyte.com \
    --cc=berrange@redhat.com \
    --cc=groug@kaod.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.