All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] 9pfs: fix DoS via Treaddir (CVE-2026-9238)
@ 2026-05-27 21:16 Christian Schoenebeck
  2026-05-27 21:15 ` [PATCH 1/8] hw/9pfs: add msize_limit transport callback Christian Schoenebeck
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Christian Schoenebeck @ 2026-05-27 21:16 UTC (permalink / raw)
  To: qemu-devel, qemu-stable
  Cc: Greg Kurz, Feifan Qian, Stefano Stabellini, Anthony PERARD,
	Edgar E. Iglesias

Feifan Qian reported a potential DoS and unbound host allocation via Treaddir
request due to msize not being capped on Tversion handshake, and allocation
size in Treaddir being capped too late.

Attack Vector of Vulnerability:

A malicious guest can negotiate a large 9P msize during Tversion handshake and
then send Treaddir request with a large 'count' parameter. The 9p server would
allocate host memory proportional to the negotiated 'msize' for collecting
directory entries, before validating that the actual reply buffer can hold the
response. If the reply buffer is smaller than what was allocated, the response
marshalling fails, but the memory has already been consumed.

This can lead to:

 - Unbound host memory allocation proportional to the negotiated msize.
 - Denial of service against the QEMU process.
 - Potential OOM conditions affecting entire host system.

This series fixes this vulnerability on two layers.

Summary of patches fixing this vulnerability:

 - Layer 1: Patches 1..4 cap msize during Tversion handshake to reasonable
   maximum value. It does so by limiting msize to the theoretical maximum
   msize value supported by transport implementation.

 - Layer 2: Patches 5..8 cap the allocated host memory in the Treaddir handler
   specifically to the current, real response buffer size of transport
   implementation.

Christian Schoenebeck (8):
  hw/9pfs: add msize_limit transport callback
  9pfs/virtio: implement msize_limit callback
  9pfs/xen: implement msize_limit callback
  hw/9pfs: cap negotiated msize to transport limit
  hw/9pfs: add response_buffer_size transport callback
  9pfs/virtio: implement response_buffer_size callback
  9pfs/xen: implement response_buffer_size callback
  hw/9pfs: cap Treaddir allocation (CVE-2026-9238)

 hw/9pfs/9p.c               | 28 ++++++++++++++++++++++++++--
 hw/9pfs/9p.h               |  2 ++
 hw/9pfs/virtio-9p-device.c | 17 +++++++++++++++++
 hw/9pfs/xen-9p-backend.c   | 18 ++++++++++++++++++
 4 files changed, 63 insertions(+), 2 deletions(-)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-06-08  7:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-27 21:16 [PATCH 0/8] 9pfs: fix DoS via Treaddir (CVE-2026-9238) Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 1/8] hw/9pfs: add msize_limit transport callback Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 2/8] 9pfs/virtio: implement msize_limit callback Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 3/8] 9pfs/xen: " Christian Schoenebeck
2026-06-08  7:43   ` Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 4/8] hw/9pfs: cap negotiated msize to transport limit Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 5/8] hw/9pfs: add response_buffer_size transport callback Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 6/8] 9pfs/virtio: implement response_buffer_size callback Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 7/8] 9pfs/xen: " Christian Schoenebeck
2026-05-27 21:15 ` [PATCH 8/8] hw/9pfs: cap Treaddir allocation (CVE-2026-9238) Christian Schoenebeck

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.