lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aBnpLP1b4Wl3krg8@arm.com>
Date: Tue, 6 May 2025 11:49:16 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: will@...nel.org, nathan@...nel.org, nick.desaulniers+lkml@...il.com,
	morbo@...gle.com, justinstitt@...gle.com, broonie@...nel.org,
	maz@...nel.org, oliver.upton@...ux.dev, joey.gouly@....com,
	shameerali.kolothum.thodi@...wei.com, james.morse@....com,
	hardevsinh.palaniya@...iconsignals.io, ardb@...nel.org,
	ryan.roberts@....com, Yeoreum Yun <yeoreum.yun@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	llvm@...ts.linux.dev, stable@...r.kernel.org
Subject: Re: [PATCH v2] arm64/cpufeature: annotate arm64_use_ng_mappings with
 ro_after_init to prevent wrong idmap generation

On Sat, May 03, 2025 at 03:11:36PM +0100, Catalin Marinas wrote:
> On Sat, May 03, 2025 at 11:16:12AM +0100, Catalin Marinas wrote:
> > On Fri, 02 May 2025 19:04:12 +0100, Yeoreum Yun wrote:
> > > create_init_idmap() could be called before .bss section initialization
> > > which is done in early_map_kernel().
> > > Therefore, data/test_prot could be set incorrectly by PTE_MAYBE_NG macro.
> > > 
> > > PTE_MAYBE_NG macro set NG bit according to value of "arm64_use_ng_mappings".
> > > and this variable places in .bss section.
> > > 
> > > [...]
> > 
> > Applied to arm64 (for-next/fixes), with some slight tweaking of the
> > comment, thanks!
> > 
> > [1/1] arm64/cpufeature: annotate arm64_use_ng_mappings with ro_after_init to prevent wrong idmap generation
> >       https://git.kernel.org/arm64/c/12657bcd1835
> 
> I'm going to drop this for now. The kernel compiled with a clang 19.1.5
> version I have around (Debian sid) fails to boot, gets stuck early on:
> 
> $ clang --version
> Debian clang version 19.1.5 (1)
> Target: aarch64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /usr/lib/llvm-19/bin

I reinstated the patch with __read_mostly and some rewriting of the
commit message (I left out the gcc code generation, it's just luck that
we have not hit it before). That's the new commit on the arm64
for-next/fixes branch:

[1/1] arm64: cpufeature: Move arm64_use_ng_mappings to the .data section to prevent wrong idmap generation
      https://git.kernel.org/arm64/c/363cd2b81cfd

I kept the original tested-by from Nathan, I reckon the patch still
works ;).

Thanks.

-- 
Catalin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ