Thread (32 messages) 32 messages, 10 authors, 7d ago

Re: [PATCH v7 15/15] arm64: mm: Unmap kernel data/bss entirely from the linear map

From: Vladimir Murzin <hidden>
Date: 2026-06-09 08:26:35
Also in: linux-arm-kernel, linux-hardening, linux-mm, linux-sh, lkml

Hi,

On 6/9/26 07:28, Marek Szyprowski wrote:
On 09.06.2026 08:22, Marek Szyprowski wrote:
quoted
On 29.05.2026 17:02, Ard Biesheuvel wrote:
quoted
From: Ard Biesheuvel <ardb@kernel.org>

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 <ardb@kernel.org>
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/ (local)

Cheers
Vladimir

Best regards
-- Marek Szyprowski, PhD Samsung R&D Institute Poland
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help