git: eca7cba74c95 - main - virtio_p9fs: Mark response buffers as initialized for KMSAN

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Tue, 27 Oct 2026 15:08:25 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=eca7cba74c95c8cd64c0ea4299984484784aa836

commit eca7cba74c95c8cd64c0ea4299984484784aa836
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-26 22:24:06 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-10-27 15:03:52 +0000

    virtio_p9fs: Mark response buffers as initialized for KMSAN
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 sys/dev/virtio/p9fs/virtio_p9fs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sys/dev/virtio/p9fs/virtio_p9fs.c b/sys/dev/virtio/p9fs/virtio_p9fs.c
index 37520bb25c76..5e24d0110dfa 100644
--- a/sys/dev/virtio/p9fs/virtio_p9fs.c
+++ b/sys/dev/virtio/p9fs/virtio_p9fs.c
@@ -32,6 +32,7 @@
 #include <sys/param.h>
 #include <sys/errno.h>
 #include <sys/module.h>
+#include <sys/msan.h>
 #include <sys/sglist.h>
 #include <sys/queue.h>
 #include <sys/bus.h>
@@ -210,6 +211,7 @@ vt9p_intr_complete(void *xsc)
 	struct vt9p_softc *chan;
 	struct virtqueue *vq;
 	struct p9_req_t *curreq;
+	uint32_t len;
 
 	chan = (struct vt9p_softc *)xsc;
 	vq = chan->vt9p_vq;
@@ -218,8 +220,9 @@ vt9p_intr_complete(void *xsc)
 
 	VT9P_LOCK(chan);
 again:
-	while ((curreq = virtqueue_dequeue(vq, NULL)) != NULL) {
+	while ((curreq = virtqueue_dequeue(vq, &len)) != NULL) {
 		curreq->rc.tag = curreq->tc.tag;
+		kmsan_mark(curreq->rc.sdata, len, KMSAN_STATE_INITED);
 		wakeup_one(curreq);
 	}
 	if (virtqueue_enable_intr(vq) != 0) {