From owner-dev-commits-src-main@freebsd.org Fri Sep 24 18:37:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5178A671DFA; Fri, 24 Sep 2021 18:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HGLNy1rfVz3jb6; Fri, 24 Sep 2021 18:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F2DC1B7CA; Fri, 24 Sep 2021 18:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18OIbM90090979; Fri, 24 Sep 2021 18:37:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18OIbMdX090978; Fri, 24 Sep 2021 18:37:22 GMT (envelope-from git) Date: Fri, 24 Sep 2021 18:37:22 GMT Message-Id: <202109241837.18OIbMdX090978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 14a634df53d2 - main - cxgbe: Mark received packets as initialized for KMSAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 14a634df53d2de65233e490d0bfa806a05baff7c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Sep 2021 18:37:22 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=14a634df53d2de65233e490d0bfa806a05baff7c commit 14a634df53d2de65233e490d0bfa806a05baff7c Author: Mark Johnston AuthorDate: 2021-09-24 18:35:38 +0000 Commit: Mark Johnston CommitDate: 2021-09-24 18:37:05 +0000 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 --- sys/dev/cxgbe/t4_sge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 8a502907d172..c2f2f0a13f5b 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -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 */