From: Kameron Carr <kameroncarr@linux.microsoft.com>
To: Haiyang Zhang <haiyangz@microsoft.com>,
Wei Liu <wei.liu@kernel.org>, Dexuan Cui <decui@microsoft.com>,
Michael Kelley <mhklinux@outlook.com>
Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/5] Documentation: hyperv: Describe validation of the ring buffer indices
Date: Mon, 19 Oct 2026 16:09:50 -0700 [thread overview]
Message-ID: <20261019230950.1573677-6-kameroncarr@linux.microsoft.com> (raw)
In-Reply-To: <20261019230950.1573677-1-kameroncarr@linux.microsoft.com>
Document that the guest must snapshot and validate the read and write
indices before using them to index into the ring buffer or to compute
the available space.
Signed-off-by: Kameron Carr <kameroncarr@linux.microsoft.com>
---
Documentation/virt/hyperv/coco.rst | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/virt/hyperv/coco.rst b/Documentation/virt/hyperv/coco.rst
index 3231e51..3e20249 100644
--- a/Documentation/virt/hyperv/coco.rst
+++ b/Documentation/virt/hyperv/coco.rst
@@ -200,7 +200,10 @@ validation is performed. For messages passed from the host to the guest in a
VMBus ring buffer, the length of the message is validated, and the message is
copied into a temporary (encrypted) buffer for further validation and
processing. The copying adds a small amount of overhead, but is the only way
-to protect against a malicious host. See hv_pkt_iter_first().
+to protect against a malicious host. See hv_pkt_iter_first(). Similarly, the
+ring buffer header is shared with the host, so the guest must snapshot and
+validate the read and write indices before using them to index into the ring
+buffer or to compute available space.
Many drivers for VMBus devices have been "hardened" by adding code to fully
validate messages received over VMBus, instead of assuming that Hyper-V is
--
2.45.4
prev parent reply other threads:[~2026-10-19 23:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-19 23:09 [PATCH v2 0/5] Drivers: hv: vmbus: Harden the ring buffer against a malicious host Kameron Carr
2026-10-19 23:09 ` [PATCH v2 1/5] Drivers: hv: vmbus: Bounds check the shared ring buffer indices Kameron Carr
2026-10-19 23:09 ` [PATCH v2 2/5] Drivers: hv: vmbus: Use *_ONCE() to access " Kameron Carr
2026-10-19 23:09 ` [PATCH v2 3/5] Drivers: hv: vmbus: Compute ring byte counts from a caller-held snapshot Kameron Carr
2026-10-19 23:09 ` [PATCH v2 4/5] Drivers: hv: vmbus: Keep the ring byte counts sane for a bad index Kameron Carr
2026-10-19 23:09 ` Kameron Carr [this message]
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=20261019230950.1573677-6-kameroncarr@linux.microsoft.com \
--to=kameroncarr@linux.microsoft.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhklinux@outlook.com \
--cc=wei.liu@kernel.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.