Commit 14a634df authored by Mark Johnston's avatar Mark Johnston
Browse files

cxgbe: Mark received packets as initialized for KMSAN

The KMSAN runtime needs to have its shadow maps updated when devices
update host memory, otherwise it assumes that device-populated memory is
uninitialized.  For most drivers this is handled transparently by
busdma, but cxgbe doesn't make use of dma maps for receive buffers and
so requires special treatment.

Reported by:	mjg
Tested by:	mjg
Reviewed by:	np
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D32102
parent e31fb971
......@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kernel.h>
#include <sys/ktls.h>
#include <sys/malloc.h>
#include <sys/msan.h>
#include <sys/queue.h>
#include <sys/sbuf.h>
#include <sys/taskqueue.h>
......@@ -1754,6 +1755,7 @@ get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int fr_offset,
return (NULL);
}
m->m_len = len;
kmsan_mark(payload, len, KMSAN_STATE_INITED);
if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) {
/* copy data to mbuf */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment