Linux 9p file system development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] 9p: bound zero-copy error replies
@ 2026-11-23 20:42 Lianjie Wang
  2026-11-23 20:42 ` [PATCH v2 1/5] 9p/virtio: clamp the reply size of a zero-copy request Lianjie Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Lianjie Wang @ 2026-11-23 20:42 UTC (permalink / raw)
  To: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet
  Cc: Lianjie Wang, Christian Schoenebeck, Al Viro, Tomas Bortoli, v9fs,
	linux-kernel, Takahiro Shinagawa

With the error reply to a zero-copy request, a virtio-9p device can make
the client read past the posted buffers (patch 1), also with an RLERROR
under 9P2000 and 9P2000.u (patch 2) and with a reply after a fatal
signal (patch 3). Patch 4 fixes a double put of a zero-copy request
interrupted by a fatal signal while waiting for the ring. Patch 5 fixes
an uninitialized value printed in a debug message.

The patches were tested with QEMU modified to send the malformed or slow
replies.

Patches 3 to 5 of v1 are left out in v2, since patch 3 of v1 fixes the
use-after-free on a request returned after the RFLUSH, but puts a freed
request returned after an umount [1], because an umount frees the client
and the requests while the device still holds them. Fixing this entirely
appears to require deferring the destruction of the client to a
workqueue until the device has returned every request, which is costly
and beyond the current scope. Patches 4 and 5 of v1 depend on patch 3,
so these patches may be sent again in a later series.

v2:
- Rebase onto v7.4-rc4.
- Add patch 2 for the RLERROR case raised in the review [2].
- In patch 3, accept a late reply within the part of rc.sdata posted for
  the header, as raised in the review [3].
- Add patch 4 for the double put that patch 3 of v1 also fixed.
- Add patch 5 for the uninitialized ecode raised in the review [4].
- Drop patches 3 to 5 of v1.

[1] https://lore.kernel.org/all/179446999129.2199510.15094266003962078465@kernel.org/
[2] https://lore.kernel.org/all/179446998758.2199510.14994914047354508278@kernel.org/
[3] https://lore.kernel.org/all/179446998948.2199510.3182298225630042557@kernel.org/
[4] https://lore.kernel.org/all/sashiko-outbox-206901@kernel.org/
v1: https://lore.kernel.org/all/20261109105251.2545764-1-lian@is.s.u-tokyo.ac.jp/

Lianjie Wang (5):
  9p/virtio: clamp the reply size of a zero-copy request
  9p/virtio: move the error string of an RLERROR into rc.sdata
  9p: bound the zero-copy reply after a fatal signal
  9p/virtio: set REQ_STATUS_SENT after adding a zero-copy request
  9p: initialize ecode in p9_check_errors()

 net/9p/client.c       | 16 ++++++++++++----
 net/9p/trans_virtio.c | 15 ++++++++++-----
 2 files changed, 22 insertions(+), 9 deletions(-)


base-commit: b6a9fa34ce4187cb69d3c588a4bbffc31ce5db8f
-- 
2.56.1


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

end of thread, other threads:[~2026-11-23 20:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 20:42 [PATCH v2 0/5] 9p: bound zero-copy error replies Lianjie Wang
2026-11-23 20:42 ` [PATCH v2 1/5] 9p/virtio: clamp the reply size of a zero-copy request Lianjie Wang
2026-11-23 20:42 ` [PATCH v2 2/5] 9p/virtio: move the error string of an RLERROR into rc.sdata Lianjie Wang
2026-11-23 20:42 ` [PATCH v2 3/5] 9p: bound the zero-copy reply after a fatal signal Lianjie Wang
2026-11-23 20:42 ` [PATCH v2 4/5] 9p/virtio: set REQ_STATUS_SENT after adding a zero-copy request Lianjie Wang
2026-11-23 20:42 ` [PATCH v2 5/5] 9p: initialize ecode in p9_check_errors() Lianjie Wang
2026-11-23 20:52 ` [PATCH v2 0/5] 9p: bound zero-copy error replies sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox