From nobody Sat Nov 04 14:29:05 2023 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 4SN0Nf03dwz50cjM; Sat, 4 Nov 2023 14:29:06 +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 4SN0Nd6dRYz4Tgw; Sat, 4 Nov 2023 14:29:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699108145; 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=7s8Wp9Iu79r9YZGS2xRwqFE8Tu2V3Yd4K4W6h6q4r7o=; b=YME5BtDzRaIH9imy7JLmajWnVDFJKTg/mj4h2ZgVifSVAuZagIbWg1ZSuaBrV2NOWnEfBu t/cbtDD6ktRNe23ugGmbtMAUOdlKlS28vD69dchPJ+swjYtz0H0Eo21pTfPaoAb0b4Y1Hd g3CqaziGOnKeR66+mB5AipZBI2G577bzYGSpjn9WUcd8UApOQjZx9PsupE9mNOEvYkhaSD iRApsFMtBxZScsO8K3xoevV5qeHoGqMzQIK59JvxSZ05M+Rt3bWZlGD1EUK/JucLfs0Xc2 r4J3AyepZFKiCttUWn6DAoEVGv6TD8bzioBnz2QJaznz6DDVAf6ZbSV6ZDBtVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699108145; 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=7s8Wp9Iu79r9YZGS2xRwqFE8Tu2V3Yd4K4W6h6q4r7o=; b=QY15QVqjBKKirI7W6kQ0ghkCz13/lI3XdqQFD7hGrYi4uBIaOB/Pha7yYNhTNW78GjAAem d7Haa6sZZjPE2vwwPE6EtqGSnhyzh1lyuvCaGhsP73TcjPicLQNsODHvB/Xf/YDWXEcypU YTl0/w9w79LEcR7e1g5QS6ZH042LjN+7jFbuKS/j4n7oh3f+GQ10PiSuCepXzgVWOjMf6g Ku6HmjnHobMrBBr/bjrihSbxLNASdtyZQEaWY1aAuVkTRGkr3B6f+j1vI+YaJvDVXRYkiG wDTPwYDVY1TaWjhPUPBk0ku6cbdfMNuCdAJL75sz7dnd6nLb/+XxI77hgHwDOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699108145; a=rsa-sha256; cv=none; b=P1asvt1ciVh4s6XXnsGrLBR6VogilgY8ZWFX5HpzQZBcfZBsX44Z4biRgN8bEtSQ+eDUoJ CSVw/U/OrTB82Gyiu2F0g149X6MIc/dRSAQXyyodwofYcFw8Rm/Sf4xOIB2cFPzoL61Eo1 DSCjWFy3gmh3tjQHFLY71JvljwUcfEBdh1a4tMZ2CkKqEzCLpgItHixT0b8bsfX+qhLFRS OpojIShXtw27os4tdYKnCkGJ036vFXskpbO/nhO9ckwFfIFpby24A9mxMxL4NMpE5H7cYm ulI9P4Dwnnh5WMrHXoYC9y7aSaBstda7NlWpY9Vp5ZoSRS/CvXcZ10roBMEpjw== 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 4SN0Nd5hQcz11n8; Sat, 4 Nov 2023 14:29:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A4ET59M019589; Sat, 4 Nov 2023 14:29:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A4ET5Fj019586; Sat, 4 Nov 2023 14:29:05 GMT (envelope-from git) Date: Sat, 4 Nov 2023 14:29:05 GMT Message-Id: <202311041429.3A4ET5Fj019586@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: 346134f19aa9 - main - kmsan: Correct the origin address in kmsan_shadow_check() 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: 346134f19aa9ba38a0384244609e2bcd4f7838f4 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=346134f19aa9ba38a0384244609e2bcd4f7838f4 commit 346134f19aa9ba38a0384244609e2bcd4f7838f4 Author: Mark Johnston AuthorDate: 2023-11-03 19:37:09 +0000 Commit: Mark Johnston CommitDate: 2023-11-04 14:28:13 +0000 kmsan: Correct the origin address in kmsan_shadow_check() Otherwise a KMSAN report (which panics the system by default) could trigger a recursive panic. MFC after: 1 week Fixes: ca6cd604c8fc ("kmsan: Use the correct origin bytes in kmsan_check_arg()") --- sys/kern/subr_msan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_msan.c b/sys/kern/subr_msan.c index f8fdcf478b79..abac71da6d64 100644 --- a/sys/kern/subr_msan.c +++ b/sys/kern/subr_msan.c @@ -375,7 +375,7 @@ kmsan_shadow_check(uintptr_t addr, size_t size, const char *hook) for (i = 0; i < size; i++) { if (__predict_true(shad[i] == 0)) continue; - orig = (msan_orig_t *)kmsan_md_addr_to_orig((vm_offset_t)&shad[i]); + orig = (msan_orig_t *)kmsan_md_addr_to_orig(addr + i); orig = (msan_orig_t *)((uintptr_t)orig & MSAN_ORIG_MASK); kmsan_report_hook((const char *)addr + i, orig, size, i, hook); break;