From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13D233C13EE for ; Wed, 3 Jun 2026 11:25:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780485918; cv=none; b=bx5tq85MFLMfGHcY40VvQdqCWCT5+CKyOdGThfmxAw4yUAgU3iHl/SO+l4wiBGwpI4iDrm3gL3ADqdasVYXozLeqDJy/z2gMGdFJ2pLGGy5twrH9CUx23/D2y3vXWbsGAteeZRTXaKXRrCBkfBXUQ9ODAcL17QO0KN/DIK1dHKY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780485918; c=relaxed/simple; bh=mQwxmxG3zUsGZ9nDWKhGbrFJTe9Hn6qRBaAUPAl9JNo=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=o5sBmUsMMv8pBGHOcB4IIqXwOwodah64qaEzz7cSyMtM8klCvorTYH985m0CiQ7ucJ0QSxEaEuad2l0TeL+7PhzjHiSdYmM/qbPmhvnbAYS1KiVPwexZPYjxSNjd7t6FIMyTMW1q62GIwheDeSA+ft8mR41pKSXouzBEP0i8h7g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=exw4XYzJ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="exw4XYzJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 228781F00898; Wed, 3 Jun 2026 11:25:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780485916; bh=Ej/A4bAeP3GRRv4aBL4VdTQbInf6PAP5PBV1hqxuGeU=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=exw4XYzJHNx8NPTpD1SzdOEOLUIA0xbYO2jphTnpVII8b31Q/9zoA+W2Rvg/yhsRJ rEc/sWlhy60ka7H0KxygsKKzTfK2eoV1T3KYgDO6PTRuKF9q3CHlxXeAxdewT+ecHQ NBSd91h0blVNopV1S8MSD25RQBFS7xz5PlvkBpwHruhFkJ3FpKkcFYAWPIuu7rzfF6 x+OGEki1CCoDqkOh1nrN5UKDwOjNctAtNOzcuXJvxl7TfG6lbZBxvDoShpMpgqqsJm 3gltOvlx5FPE7bceYtY1n+j09Xo/ig1esnSx7M+rmwf6cTja4OnJ8sQgCh4Xrx7MK9 Q3cwykG/gR1EA== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id 35B68F40070; Wed, 3 Jun 2026 07:25:15 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-01.internal (MEProxy); Wed, 03 Jun 2026 07:25:15 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTGk07hpe1NCwTVIzfP2HgIVR+mhM9tsG3G5fFNmt40ZyD0SKBCj9VlPFNEJ/mKYg+ yn9XCnk7DMqqvKhYAonBnb+EiK7yyt6XwsAKFP1NRUIxeRopUJbCzFAEtgdZwZ2syq6mLt hIc8ns+tGdiT78GcOIddkRPvwXakkAXz6AaOGjfod1A73n2hhP0S+irMK6MY6pmOGSphLV 9LSrur6d22T4VrRb0o5gM+dJx+HdoAtQGS5mxYoTkKVSFjuFyOM+kuaRmHmk5SGbsP2X5U zTfs5UQKk93YP1gI0iWsago6o9Zae+QmHbKuHZObMf4rdXX8pu80r92+oAHgcVeIlkcQDt 0QoJr48G7g3k7Axy3vrUiaTuSSNl5Y+BBkBWhf7/BIuAoakZ1dJtZrM+QYGf6QD0T7M/C0 ueKDXo5EQVNDoS+0A/91fYorYH01AUmS/P8O4XOQS5akirZ4o6R39OVDG5ahWkb2lF336H YbIyD0BajwqJNC5uYkvP7UDCRsQcdeI+orDmIIjHhBz6YSpbphRyIkD91JJ5F8fMl9IFqF a0YT3rtTfzLsSqiNI66DGkElA3Hc8cBk3YfeNWCCudJjd2gSSl3qVSUppja1jEfUb97L0h hPAd/USZemqekfo8KMLkrAbpwvAtpzbyCrEKM6liYSn40sbEKKE762X7+RKw X-ME-Proxy: Feedback-ID: ice86485a:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0E8AE182007E; Wed, 3 Jun 2026 07:25:14 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Wed, 03 Jun 2026 13:24:53 +0200 From: "Ard Biesheuvel" To: "Will Deacon" Cc: linux-arm-kernel@lists.infradead.org, "Ard Biesheuvel" , "Catalin Marinas" , kernel-team@android.com, linux-kernel@vger.kernel.org, "Mark Rutland" , "Ryan Roberts" , "Anshuman Khandual" , "Kevin Brodsky" , "Liz Prucka" , "Seth Jenkins" , "Kees Cook" , "Mike Rapoport" , "David Hildenbrand" , "Andrew Morton" , "Jann Horn" , linux-mm@kvack.org, linux-hardening@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, maz@kernel.org Message-Id: In-Reply-To: References: <20260529150150.1670604-17-ardb+git@google.com> <178041415770.4024555.11336437584927054639.b4-ty@kernel.org> <2c7929d4-6622-475d-af1b-bcd0cd997cd3@app.fastmail.com> Subject: Re: [PATCH v7 00/15] arm64: Unmap linear alias of kernel data/bss Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 3 Jun 2026, at 13:22, Will Deacon wrote: > On Wed, Jun 03, 2026 at 10:57:49AM +0200, Ard Biesheuvel wrote: >> (cc Marc) >> >> On Tue, 2 Jun 2026, at 22:34, Will Deacon wrote: >> > On Fri, 29 May 2026 17:01:51 +0200, Ard Biesheuvel wrote: >> >> One of the reasons the lack of randomization of the linear map on arm64 >> >> is considered problematic is the fact that bootloaders adhering to the >> >> original arm64 boot protocol (i.e., a substantial fraction of all >> >> Android phones) may place the kernel at the base of DRAM, and therefore >> >> at the base of the non-randomized linear map. This puts a writable alias >> >> of the kernel's data and bss regions at a predictable location, removing >> >> the need for an attacker to guess where KASLR mapped the kernel. >> >> >> >> [...] >> > >> > It would've been nice to hear from the ppc folks on patch 11, but I've >> > picked it up on the assumption that they'll love the negative diff stat. >> > Worst case, we can drop/revert stuff if they have late objections. >> > >> >> Thanks. >> >> There is a de facto ack from Michael Ellerman in the Link:, which is why >> I included it. >> >> Note that Sashiko found an issue with KVM+MTE, where a read-only mapping >> of the zero page in the linear map may result in issues: >> >> """ >> Does moving the zero page to .rodata (or unmapping/read-only mapping its >> linear alias) expose a guest-to-host denial of service with KVM and MTE? >> When an MTE-enabled KVM guest reads an unmapped memory address, KVM handles >> the stage-2 fault by mapping the host's shared zero page. KVM will then >> call sanitise_mte_tags() in arch/arm64/kvm/mmu.c. >> Since the PG_mte_tagged flag is never set on the zero page, KVM's >> try_page_mte_tagging() succeeds, and it calls mte_clear_page_tags(). >> This executes the STGM instruction using the zero page's linear map alias. >> If this alias is read-only or unmapped, won't the STGM instruction trigger >> a synchronous permission fault or translation fault in EL1, causing a host >> kernel panic? >> """ >> >> Marc seems to think it is legit, so I came up with the following (I'll send >> it out separately with another pair of tweaks): > > Thanks, it also looks like we're getting some early WARN_ON()s firing in > CI from split_kernel_leaf_mapping() after applying your changes: > > https://s3.amazonaws.com/arr-cki-prod-trusted-artifacts/trusted-artifacts/2571596185/test_aarch64/14662134813/artifacts/jobwatch/logs/recipes/21399931/tasks/219104268/results/1007729692/logs/journalctl.log > OK I'll investigate