git: 1e314d8c1ff9 - stable/15 - virtio_p9fs: Mark response buffers as initialized for KMSAN

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 06 Nov 2026 19:54:57 UTC
The branch stable/15 has been updated by markj:

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

commit 1e314d8c1ff9e4312d23fcb654058f312effe7ab
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-10-26 22:24:06 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-11-06 15:52:19 +0000

    virtio_p9fs: Mark response buffers as initialized for KMSAN
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit eca7cba74c95c8cd64c0ea4299984484784aa836)
---
 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 7586c5f03cf7..ebdf7a598c15 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) {