From nobody Sun Jun 16 18:11:17 2024 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 4W2LgC0LyYz5PDd6; Sun, 16 Jun 2024 18:11:19 +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 4W2Lg93CQKz4gXC; Sun, 16 Jun 2024 18:11:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718561477; 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=0OF6UbOfebkiHJG+B9mqKQDcRZ3j3+v6aa9eXMJIbvQ=; b=OvhBJdMgB+ExspiQr0/777D7R3luiY1bJ9tHRsvGOEONL3whpYU198YgAVwVeX4KActMO+ Sp62FLUeHR0wmT1NruQjIJANnvy6ONg1QqEC8CUDuFpzT0Cb53Amwk0un7oKAkscJNZo7J 5F4gZ+E/zNxH0eoI7sIiI0pADGMMwM3Se0v1eskAs4f2fgoBMHyPLnNL+nCrs5/cO0LorS pn3/L1JQctNylUQ2Z9Q/khx83y+F+MmSnDg7oWSjpKsWUIk0gsRjAQ2K3aY54sY3KtrUsM 8mdp+pE4S9X4ErhOSK2LmMaQCi6Zm9jPLXvm5GiRFdtXjdAh0rR0ZcbwKlrw7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718561477; a=rsa-sha256; cv=none; b=ftT+qKe/YfHUIEaAEiwwvwkjjIEcCmUX+QwQGa49PS6LJq/AINgmCyNWu9maAFB0AUNtPF w4X6wITSHnsedFw+iSNFgpqQhE0VWvxzPUzoSaxuku1mkpL3KGuIQs/0fWRBeHiNnZEhef ygaCutrmfL2Z2ZtJutLTNVwNpIYv//si8/Mjej3szvP7y69zd+3oCkapqP9TvmCFfGEJqJ 64NqozccGxZb/XFX4Sl9gx0/YNpvGjSPfTH0fKOoX5SokhozEmpaf7Dwts42aUkTO4JwT6 vUThHbPKKisK8VISfL5qBUGoP4/Eyj0VcQDYTzjyWIfpIAlH+DVNKfQC8Ymyhw== 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=1718561477; 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=0OF6UbOfebkiHJG+B9mqKQDcRZ3j3+v6aa9eXMJIbvQ=; b=mNc8+Pb79kg7R1dfDXNh+fL8q75tG2NEGczJhxfhMCvMTj+0kO4fw1kB50SOd2Zga+ypa5 /lFKb5e5HSSCmaxsqxRbNG6LW3EFoUSmxH4n4AsgNBIfxyfF0vUORUoritxpCe4wFK8xAZ uQzR1uqlGTbDF6RJrYnwTq5pbjJW805giWwjHIaNpPNWHNCH0ChE1XBkOBZKK+63WfMLNx TiBpFDVe10zu8NGgoevI8vEmTi5L2JjNCg2/zaklxKpef+LBYvJ1jqrhX/aSXKuSxEJM94 mraowea9IUjIXtOAOL+y2Hi8Fwpia99VJ3rxWQA2Pd7zfsag9m3TT9iOF72XGQ== 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 4W2Lg92pQxzxBm; Sun, 16 Jun 2024 18:11:17 +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 45GIBH20039504; Sun, 16 Jun 2024 18:11:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45GIBHoN039501; Sun, 16 Jun 2024 18:11:17 GMT (envelope-from git) Date: Sun, 16 Jun 2024 18:11:17 GMT Message-Id: <202406161811.45GIBHoN039501@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: 46bb2dca534a - main - kasan: Increase the size of the bootstrap PTP reservation 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 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: 46bb2dca534ae1dfe95ea11c915b441e4867a310 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=46bb2dca534ae1dfe95ea11c915b441e4867a310 commit 46bb2dca534ae1dfe95ea11c915b441e4867a310 Author: Mark Johnston AuthorDate: 2024-06-16 17:33:13 +0000 Commit: Mark Johnston CommitDate: 2024-06-16 17:33:13 +0000 kasan: Increase the size of the bootstrap PTP reservation We were undercounting in the case where the boot stack crosses a 2MB boundary, resulting in a panic during locore execution. MFC after: 1 week Fixes: 756bc3adc578 ("kasan: Create a shadow for the bootstack prior to hammer_time()") --- sys/amd64/amd64/pmap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index dee208fc9145..57943e815b5b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -11671,15 +11671,16 @@ pmap_pkru_clear(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) * Reserve enough memory to: * 1) allocate PDP pages for the shadow map(s), * 2) shadow the boot stack of KSTACK_PAGES pages, - * so we need one PD page, one or two PT pages, and KSTACK_PAGES shadow pages - * per shadow map. + * 3) assuming that the kernel stack does not cross a 1GB boundary, + * so we need one or two PD pages, one or two PT pages, and KSTACK_PAGES shadow + * pages per shadow map. */ #ifdef KASAN #define SAN_EARLY_PAGES \ - (NKASANPML4E + 1 + 2 + howmany(KSTACK_PAGES, KASAN_SHADOW_SCALE)) + (NKASANPML4E + 2 + 2 + howmany(KSTACK_PAGES, KASAN_SHADOW_SCALE)) #else #define SAN_EARLY_PAGES \ - (NKMSANSHADPML4E + NKMSANORIGPML4E + 2 * (1 + 2 + KSTACK_PAGES)) + (NKMSANSHADPML4E + NKMSANORIGPML4E + 2 * (2 + 2 + KSTACK_PAGES)) #endif static uint64_t __nosanitizeaddress __nosanitizememory