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: <b0b11c57-e45b-4a53-8dba-93e8ce5800c1@arm.com>
Date: Thu, 11 Sep 2025 12:52:02 +0200
From: Kevin Brodsky <kevin.brodsky@....com>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
 Anshuman Khandual <anshuman.khandual@....com>,
 Catalin Marinas <catalin.marinas@....com>, Kees Cook <kees@...nel.org>,
 Mark Rutland <mark.rutland@....com>, Ryan Roberts <ryan.roberts@....com>,
 Suzuki K Poulose <suzuki.poulose@....com>, Will Deacon <will@...nel.org>,
 Yeoreum Yun <yeoreum.yun@....com>
Subject: Re: [PATCH] arm64: mm: Move KPTI helpers to mmu.c

On 11/09/2025 11:19, Ard Biesheuvel wrote:
>> diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h
>> index 49f1a810df16..624edd6c4964 100644
>> --- a/arch/arm64/include/asm/mmu.h
>> +++ b/arch/arm64/include/asm/mmu.h
>> @@ -104,5 +104,11 @@ static inline bool kaslr_requires_kpti(void)
>>         return true;
>>  }
>>
>> +#ifdef CONFIG_UNMAP_KERNEL_AT_EL0
>> +void kpti_install_ng_mappings(void);
>> +#else
>> +static inline void kpti_install_ng_mappings(void) {}
>> +#endif
>> +
> Nit: you might just keep the former declaration, and check for
> IS_ENABLED(CONFIG_UNMAP_KERNEL_AT_EL0) in the function, rather than
> propagating this distinction to the header file.
> But either is fine with me.

That's an option, but that would mean removing the #ifdef around the
functions defined in mmu.c. They would probably get eliminated by the
linker if the CONFIG isn't defined, but I'm not so sure about the static
variable (kpti_ng_temp_alloc). Probably not a big deal but I feel
keeping the #ifdef is more self-documenting as well.

- Kevin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ