linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: kaslr: Fix build failure with CONFIG_ARCH_RANDOM=n
@ 2020-02-13  4:24 Samuel Holland
  2020-02-13  9:17 ` Will Deacon
  0 siblings, 1 reply; 2+ messages in thread
From: Samuel Holland @ 2020-02-13  4:24 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Mark Brown
  Cc: linux-arm-kernel, linux-kernel, Samuel Holland

Commit 2e8e1ea88cbc ("arm64: Use v8.5-RNG entropy for KASLR seed")
introduced unconditional use of arm64-specific functions exported by
asm/archrandom.h. With CONFIG_ARCH_RANDOM=y, this header is transitively
included through linux/random.h. However, with CONFIG_ARCH_RANDOM=n,
this header is not included, and the kernel fails to build.

Explicitly include asm/archrandom.h so __early_cpu_has_rndr() and
__arm64_rndr() are always available, even when they are just stubs.

Fixes: 2e8e1ea88cbc ("arm64: Use v8.5-RNG entropy for KASLR seed")
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
 arch/arm64/kernel/kaslr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c
index 53b8a4ee64ff..91a83104c6e8 100644
--- a/arch/arm64/kernel/kaslr.c
+++ b/arch/arm64/kernel/kaslr.c
@@ -11,6 +11,7 @@
 #include <linux/sched.h>
 #include <linux/types.h>
 
+#include <asm/archrandom.h>
 #include <asm/cacheflush.h>
 #include <asm/fixmap.h>
 #include <asm/kernel-pgtable.h>
-- 
2.24.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64: kaslr: Fix build failure with CONFIG_ARCH_RANDOM=n
  2020-02-13  4:24 [PATCH] arm64: kaslr: Fix build failure with CONFIG_ARCH_RANDOM=n Samuel Holland
@ 2020-02-13  9:17 ` Will Deacon
  0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2020-02-13  9:17 UTC (permalink / raw)
  To: Samuel Holland
  Cc: Catalin Marinas, Mark Brown, linux-arm-kernel, linux-kernel

On Wed, Feb 12, 2020 at 10:24:57PM -0600, Samuel Holland wrote:
> Commit 2e8e1ea88cbc ("arm64: Use v8.5-RNG entropy for KASLR seed")
> introduced unconditional use of arm64-specific functions exported by
> asm/archrandom.h. With CONFIG_ARCH_RANDOM=y, this header is transitively
> included through linux/random.h. However, with CONFIG_ARCH_RANDOM=n,
> this header is not included, and the kernel fails to build.
> 
> Explicitly include asm/archrandom.h so __early_cpu_has_rndr() and
> __arm64_rndr() are always available, even when they are just stubs.
> 
> Fixes: 2e8e1ea88cbc ("arm64: Use v8.5-RNG entropy for KASLR seed")
> Signed-off-by: Samuel Holland <samuel@sholland.org>
> ---
>  arch/arm64/kernel/kaslr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c
> index 53b8a4ee64ff..91a83104c6e8 100644
> --- a/arch/arm64/kernel/kaslr.c
> +++ b/arch/arm64/kernel/kaslr.c
> @@ -11,6 +11,7 @@
>  #include <linux/sched.h>
>  #include <linux/types.h>
>  
> +#include <asm/archrandom.h>
>  #include <asm/cacheflush.h>
>  #include <asm/fixmap.h>
>  #include <asm/kernel-pgtable.h>

Already queued up in arm64 for-next/fixes:

https://fixes.arm64.dev/

Will

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-13  9:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13  4:24 [PATCH] arm64: kaslr: Fix build failure with CONFIG_ARCH_RANDOM=n Samuel Holland
2020-02-13  9:17 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).