From nobody Sat Nov 11 17:30:46 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 4SSN530gnBz50Tn2; Sat, 11 Nov 2023 17:30:47 +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 4SSN530GGDz4VVN; Sat, 11 Nov 2023 17:30:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699723847; 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=+qcSG5WxDRHjZnMdEj+Qgc5HU0ao1QIgsqz1cSn1iHU=; b=J5JCGwwdyf7PxH747VPL7LeYNVQdIL/+6fGZ/HC482+B4Z8sGmhsXoGym+PKQ+/24Dk2MH hkw2wBYUCA6Rp4WdC58PJkn/bSWss7mUmS2As1bVOqLqGpe4ZfzARkfYnxeyEtxTBiWXlL KxcgokkfNv76hFbSvbOmsMR6alRCueRlIcB/6MdsUMhtdWOowbngx26QGnjoVbs7viEzOs jnjl2oUurLqDrn+3uEtBytslMKBx2gRuhXRIA66pK3b7/LnWqzLAJeC7GVt82xi2fPu1/v Q7QkNz4psdVeFYww+zRr9rgLwr+roPrskPJPmUJIoEIIu8DhQHJoR1x5g0H9vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699723847; 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=+qcSG5WxDRHjZnMdEj+Qgc5HU0ao1QIgsqz1cSn1iHU=; b=kd7ytKL/b/MHLfSgkr/IjF8awHgFwJd1TV01m/rhzQowE/etFLN+DLOoW/pE4W3WZxhAP8 B+Ja9fXs4R/wRvjFPA8KXBnoLzRtkide9tTGTokZC0lVYFoRTMD0iBzYHPjBsiomkZqwP8 ZICLv1ConNu7Qo3lj8QLi0SoB0z+8Ih4nkW9RX463Vw2lDpoOtMF9F/MvupDIxWjn4L0dr 1F5PTOAwtURV+BuEhAHSIt8MAcvIigbdV20+7OGi7giZcbi0M3t6/Feg3pEqWpugOaRQLA Lyqu9HBIt12BbXmBjwvbtn+9JiTT7qDstVNnO+7Iqj6dIxgwC6h7bPaqVZnf/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699723847; a=rsa-sha256; cv=none; b=jqjCXHpwOehEFgL0drZtjl0vMm0XZVqPu1+avf/FP5g80nLuL5RUQccS9Xrj/vq4vPcqSJ r2mpk0F3J5viDDsxT5j/k92V+EaJ31/J1PnoaZ7eabIIZsQh5jTM2jd3Cpr2CbTdnf9QJI vJtOfrYM2SbWNN9gYemNXV/pIHBWxiF8kN+vFqG5IX86+V9F4ZbbmM8xyz5P2tPpYEWtr8 xGXLFPyK2qqyUz+Qut3qHBXWqGbzr3jWNv5IT0zoIyU6iUtzhtObcDLrS5fUwN02tTgLfg 7UvxlU8hbhBzaNXdgS/nfANC58sMCWwZd0ejoacKGkB3tPEKoddWg8BTy6VaOg== 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 4SSN526RHhzpZy; Sat, 11 Nov 2023 17:30:46 +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 3ABHUkga065337; Sat, 11 Nov 2023 17:30:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ABHUk8D065334; Sat, 11 Nov 2023 17:30:46 GMT (envelope-from git) Date: Sat, 11 Nov 2023 17:30:46 GMT Message-Id: <202311111730.3ABHUk8D065334@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 5d15f0d5406b - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 5d15f0d5406b6d27ecc8fa21a6d93754bf6c85f4 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=5d15f0d5406b6d27ecc8fa21a6d93754bf6c85f4 commit 5d15f0d5406b6d27ecc8fa21a6d93754bf6c85f4 Author: Mark Johnston AuthorDate: 2023-11-03 19:37:09 +0000 Commit: Mark Johnston CommitDate: 2023-11-11 17:30:37 +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()") (cherry picked from commit 346134f19aa9ba38a0384244609e2bcd4f7838f4) --- 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;