From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEF38CD8CAD for ; Tue, 9 Jun 2026 08:26:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RNEiL25jLm9POHPH27wOyewK7kZxaI+xHPG08xT1M34=; b=SVRnBHnmRXHQNBhw5RyGx9Tt5Q zBWFU/dilR4s18B0wm5s+1+y6/kpSrvxj5+/V7eG/xxY3cYf4OVEOprRRkg+CFuPi9YVMsLx8TGPy LOQ1aDcM2VoZ5yT5whF06rxAWE6vI+rD6hxK1/NLwS4BWe63YmXNCBx+dInbpku3vtD6px48fA/fb psDUNGzoVhdfslo4+RGLMBeoyJQQZxiBVXUwVkir9eWy9+SZpNeEqtz9+zO93073GsCz8aNZ9dfEF y1khcJarDHpaGTekqITKpJC2uUs3UEd9QibZfieulegvz1UaqlDIxC/rJh2XdG9sWK7u+kaDHRlzH HnAdHm7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wWrnF-000000053xH-3RA1; Tue, 09 Jun 2026 08:26:41 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wWrnD-000000053wU-1U8w for linux-arm-kernel@lists.infradead.org; Tue, 09 Jun 2026 08:26:40 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1BB552437; Tue, 9 Jun 2026 01:26:30 -0700 (PDT) Received: from [10.1.38.173] (e121487-lin.cambridge.arm.com [10.1.38.173]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AF7863F93E; Tue, 9 Jun 2026 01:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1780993594; bh=Yoo/97pymrQY5ONHYeyzpmC5cmDHw3EWNj3VX3KKs18=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mJaSDUGckTEW2cEbViQ2Y9cbstKnsRfKnWiSBkOsT20+8kN+ghoWrdrovk4UE4G92 gj/2Tpf8iA1JtlD+yUL6Ew15movzmGVGJldLk+P4cITzDAI/Y+W3366q2yK018N9RJ V7e5CVm3j2zR/TdePl7zFwH4kY7u9AHYNyBhTkkg= Message-ID: <4f635592-b294-4303-a045-d529de29875c@arm.com> Date: Tue, 9 Jun 2026 09:26:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v7 15/15] arm64: mm: Unmap kernel data/bss entirely from the linear map To: Marek Szyprowski , Ard Biesheuvel , linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, will@kernel.org, catalin.marinas@arm.com, mark.rutland@arm.com, Ard Biesheuvel , 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 References: <20260529150150.1670604-17-ardb+git@google.com> <20260529150150.1670604-32-ardb+git@google.com> <6a9c0f55-fe98-4063-864b-8f7e1f4fefd7@samsung.com> Content-Language: en-GB From: Vladimir Murzin In-Reply-To: <6a9c0f55-fe98-4063-864b-8f7e1f4fefd7@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260609_012639_490668_01948D35 X-CRM114-Status: GOOD ( 12.21 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 6/9/26 07:28, Marek Szyprowski wrote: > On 09.06.2026 08:22, Marek Szyprowski wrote: >> On 29.05.2026 17:02, Ard Biesheuvel wrote: >>> From: Ard Biesheuvel >>> >>> The linear aliases of the kernel text and rodata are also mapped >>> read-only in the linear map. Given that the contents of these regions >>> are mostly identical to the version in the loadable image, mapping them >>> read-only and leaving their contents visible is a reasonable hardening >>> measure. >>> >>> Data and bss, however, are now also mapped read-only but the contents of >>> these regions are more likely to contain data that we'd rather not leak. >>> So let's unmap these entirely in the linear map when the kernel is >>> running normally. >>> >>> When going into hibernation or waking up from it, these regions need to >>> be mapped, so map the region initially, and toggle the valid bit so >>> map/unmap the region as needed. >>> >>> Doing so is required because pages covering the kernel image are marked >>> as PageReserved, and therefore disregarded for snapshotting by the >>> hibernate logic unless they are mapped. >>> >>> Signed-off-by: Ard Biesheuvel >> This commit landed in yesterday's linux-next as commit 63e0b6a5b693 >> ("arm64: mm: Unmap kernel data/bss entirely from the linear map"). >> In my tests I found that it breaks booting of RaspberryPi3 and >> RaspberryPi4 boards with the following kernel panic: > One more comment - reverting 63e0b6a5b693 and 53205d56212c (dependent > change) on top of next-20260608 fixes this issue. > Thanks for report! It seems it already has been reported and discussed in another thread [1]. [1] https://lore.kernel.org/linux-arm-kernel/aicVyebkEMs6w6UV@sirena.co.uk/ Cheers Vladimir > Best regards > -- Marek Szyprowski, PhD Samsung R&D Institute Poland >