From nobody Mon Jun 20 17:00:27 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 001508775C1; Mon, 20 Jun 2022 17:00:28 +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 4LRbVz6YkKz3DGk; Mon, 20 Jun 2022 17:00:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655744427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gofzXBo7BCsQqYrDw3FssLiuWtfj/OiWWMGK1GVPDDY=; b=Is53HiArkKKQaaAETdKiy2/tJQhyuKTAYnNN6TNx7fGlxt99laycLbsEBmHORbvzc9qNu+ H6tD7h7XSxwfocM2Yo4ZtsyI5C3d78jcLgmOsYCvRcOHsV55uKfaV+VsoGbr00QbQsCxx3 Nzkk3gIkWY2Y32b1+Ea6wJbtKuUVdepgMYg+iu9PBZsYtXVawiMeZRV/JWBS4JcfRrfBKJ wZE/q2ZRwZ4m3jgT7Qqhh9gOLJ4AQ6+VXfhdFX1xWQQGKFBd9stMEphlcMUTWrh/QhXiP5 d7CafAXfUK/BOXqc22B8yeSq4hsf+oyaOw0BiNIXsuFkks7z34UV6AH55oSpMw== 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 C187A20D63; Mon, 20 Jun 2022 17:00:27 +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 25KH0RIb049724; Mon, 20 Jun 2022 17:00:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25KH0RTF049723; Mon, 20 Jun 2022 17:00:27 GMT (envelope-from git) Date: Mon, 20 Jun 2022 17:00:27 GMT Message-Id: <202206201700.25KH0RTF049723@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: a932a5a64982 - main - uma: Mark zeroed slabs as initialized for KMSAN List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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: a932a5a649823fda05e89f7757cc59339da8e2aa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655744427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gofzXBo7BCsQqYrDw3FssLiuWtfj/OiWWMGK1GVPDDY=; b=nmwrTaI9bIRruGAYnIwS5GpGHhD8rez4Q94M7A9QGP4r3Gqmqy7swvBSXlfJhOndEhRZ2o sbMskOQ9LSY+c6/6pEV7bGPQ/J5qgIwabqh17zVTAYc+LL8IRBxy3qRBFPKHLTwn7nV+CQ 8tPYS697Hn+72ZPKj0+ZugJCPeOpLkS/UskVrXADfiE0+kVTyi4B2HWAmIyTR584l/cTTL HXciPrmHoRQPgqf45LAXN6cDKJ6Lx5MwebJNDaiVYjFNfKNCq1v8EE9EAmq55leXtIDPCP X1kP5DPtsVgZTrnaeY55gnRaUlCXZpXZzgoqO9aTctZ9hmcxNjIZmhDC0Ma2gQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655744427; a=rsa-sha256; cv=none; b=y1DnKGwWqQ6epqnwXCLW0BF6ItBLkZqdle+UQeF0Dk81Fk+gzzoFdQtmLi7j2epKqqKBxU XzxxhuqVJYQRSmWC4DdWT6+aLVJHcF/maDhKYKu3aVCPPgFJ9pW56E6z3cn3F4IZLLmegs 6CWQ1LFKPk4nwCX8rvR+0jDJWSoTP0IJ6oAvO1Ftc5YqJ0Ca9+tzzPlEhHcFNNaddgINwP PAFs1k0ddkUka6IIxgpO+G0Z5+AAqaRfhO/DTCC5Lh0myiwQVFdxpl0WEGrSlIlcGcFnJM yvLujVXcFwcjFC9+peo1irWLQOTwYl5gTQgWGvEEVP7/5pQQu96eZh/Ik276zA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a932a5a649823fda05e89f7757cc59339da8e2aa commit a932a5a649823fda05e89f7757cc59339da8e2aa Author: Mark Johnston AuthorDate: 2022-06-20 15:50:54 +0000 Commit: Mark Johnston CommitDate: 2022-06-20 16:48:13 +0000 uma: Mark zeroed slabs as initialized for KMSAN Otherwise zone initializers can produce false positives, e.g., when lock_init() attempts to detect double initialization. Sponsored by: The FreeBSD Foundation --- sys/vm/uma_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index dfa3138a34f9..8502719cac72 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1805,6 +1805,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t zone, int domain, int flags, if ((keg->uk_flags & UMA_ZFLAG_HASH) != 0) domain = 0; + kmsan_mark(mem, size, + (aflags & M_ZERO) != 0 ? KMSAN_STATE_INITED : KMSAN_STATE_UNINIT); + /* Point the slab into the allocated memory */ if (!(keg->uk_flags & UMA_ZFLAG_OFFPAGE)) slab = (uma_slab_t)(mem + keg->uk_pgoff);