From nobody Fri Jul 31 19:48:06 2026 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 4hBc7J4ljCz6nR7y for ; Fri, 31 Jul 2026 19:48:12 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hBc7J18YLz4PLq for ; Fri, 31 Jul 2026 19:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785527292; 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=xQFdY8QTGN8Jd5raK6woJA31gp3hhTYCj3+32I3ODw8=; b=bVtD3P7fJhagA31ffuJ7Fs2IddsL99pW56TEnz76bHdUV3uqkKxJ8OrX+F0Mb+V90SmjtT 1gBh97bu5UnxpRxKCWvSSiwnUv+PvQKHD/8qkwQEXDIKE+5xLVDFEeM0q1FFyPPcKps+0R adYVJa/PzWFF4fkQIGrlLrsOC+xttDxl+xl1GziFpVHxyMeInPpATIGVcJpX5wUxmrS1Cn nl32IAsrp7dIor1rZH1G6me8pM2zdstvIwxv3UwJUctAeAk+ZXHHoveUTCB5U9ISRbt92t ogAsdiI4aQ38EskBpBaqP96KpLpPieGV/y4+ynxpLiTKl1y3NfIhVJLCr7gosQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1785527292; a=rsa-sha256; cv=none; b=Qb9nEaQXTCybwJ9Iru6dTiud8Kj/JcqQGeheR7nueRwGVvcU0ux4GPk9Mp96vEOFAiSLiQ ALVtoUnu42X6ktH5zx/RfqxAKljLYkklfrPlFoAMxdQeZI6ew1pacb9sixedYJ9B3jtMQn GflCxb8GsMmOg29TkrcX8azYiJfDaAvRAMD8kCyFtDm40/rzkwgu8Jv8zTBoV5ijvgtUVF FkHilnBMCTcBJZI/0BKZVOmqecT6jBrDvofcgbdCIEUlPSL7Rx+Q+OO91aePrwdYiu1Yfp iUhTyC41651VYYOJOiIKCQnsk91RHZugSyiuI8cJRRMe08c2zfxdOABEX+C6Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1785527292; 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=xQFdY8QTGN8Jd5raK6woJA31gp3hhTYCj3+32I3ODw8=; b=GhFROi+u4MqEx27vlDroEqyyUc+rw9DWOhdhmVdbW275IN/Q9ag9P5iZ4HpvFCbFbZOchN P6W4UR5BykQVfxC9l3dmoT0mU9PQDUEZQkgIEsaP9gMKIQlQJyPf6KYdl0GFb5OqAvxkfS X5nvw8+9gQyTWpk2NPsTDT8MZXZosuVqBG8tzq8AMBUBqgGa6OBoMJ//H59VJ07cVZ/A2H 5RlEXgdRiMKXPNpoSNrZO+mCyNGouDzBpAs4Lp25kV74Qfg5jrt+TAZv789yg8Bo+bxjtU /Yt4/E7+rmX/kheBtuXVyzs7UKPUoaMDANoSUNoxzJeszTg5P58ncMiHg68PPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hBc7H69LWz1CVM for ; Fri, 31 Jul 2026 19:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2493d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 31 Jul 2026 19:48:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ea7d35526878 - main - uma: Fix KMSAN integration with malloc zones 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: ea7d35526878ebf82f10080795e462d007485bf1 Auto-Submitted: auto-generated Date: Fri, 31 Jul 2026 19:48:06 +0000 Message-Id: <6a6cfbf6.2493d.6830f022@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ea7d35526878ebf82f10080795e462d007485bf1 commit ea7d35526878ebf82f10080795e462d007485bf1 Author: Mark Johnston AuthorDate: 2026-07-31 19:47:10 +0000 Commit: Mark Johnston CommitDate: 2026-07-31 19:47:10 +0000 uma: Fix KMSAN integration with malloc zones In commit 459aa032e872 I dropped kmsan_mark() calls from malloc() on the basis that UMA and kmem_malloc() would handle updates of the KMSAN shadow map. However, I missed that UMA explicitly does not handle this. Modify UMA to only omit origin map updates for malloc zones. Fixes: 459aa032e872 ("malloc: Refactor redzone and sanitizer handling") Reviewed by: rlibby Differential Revision: https://reviews.freebsd.org/D58574 --- sys/vm/uma_core.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index fefb90b497b0..cfb111d5bde8 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -635,8 +635,7 @@ kmsan_mark_item_uninitialized(uma_zone_t zone, void *item) size_t sz; int i; - if ((zone->uz_flags & - (UMA_ZFLAG_CACHE | UMA_ZONE_SECONDARY | UMA_ZONE_MALLOC)) != 0) { + if ((zone->uz_flags & (UMA_ZFLAG_CACHE | UMA_ZONE_SECONDARY)) != 0) { /* * Cache zones should not be instrumented by default, as UMA * does not have enough information to do so correctly. @@ -645,9 +644,6 @@ kmsan_mark_item_uninitialized(uma_zone_t zone, void *item) * * Items from secondary zones are initialized by the parent * zone and thus cannot safely be marked by UMA. - * - * malloc zones are handled directly by malloc(9) and friends, - * since they can provide more precise origin tracking. */ return; } @@ -662,7 +658,9 @@ kmsan_mark_item_uninitialized(uma_zone_t zone, void *item) sz = zone->uz_size; if ((zone->uz_flags & UMA_ZONE_PCPU) == 0) { - kmsan_orig(item, sz, KMSAN_TYPE_UMA, KMSAN_RET_ADDR); + /* malloc(9) updates the origin map itself. */ + if ((zone->uz_flags & UMA_ZONE_MALLOC) == 0) + kmsan_orig(item, sz, KMSAN_TYPE_UMA, KMSAN_RET_ADDR); kmsan_mark(item, sz, KMSAN_STATE_UNINIT); } else { pcpu_item = zpcpu_base_to_offset(item);