* [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU
@ 2022-08-17 9:46 Andrea Righi
2022-08-17 13:16 ` Mark Brown
2022-08-17 13:51 ` Will Deacon
0 siblings, 2 replies; 4+ messages in thread
From: Andrea Righi @ 2022-08-17 9:46 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon
Cc: Greg Kroah-Hartman, linux-arm-kernel, linux-kernel
The CONFIG_ARCH_RANDOM .config option has been removed by
commit 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM").
Depend on CONFIG_RANDOM_TRUST_CPU to determine whether we can rely on
__arm64_rndr() to initialize the seed for kaslr.
Fixes: 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM")
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
---
arch/arm64/kernel/pi/kaslr_early.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/pi/kaslr_early.c b/arch/arm64/kernel/pi/kaslr_early.c
index 6c3855e69395..a1e6f90cb6e2 100644
--- a/arch/arm64/kernel/pi/kaslr_early.c
+++ b/arch/arm64/kernel/pi/kaslr_early.c
@@ -94,7 +94,7 @@ asmlinkage u64 kaslr_early_init(void *fdt)
seed = get_kaslr_seed(fdt);
if (!seed) {
-#ifdef CONFIG_ARCH_RANDOM
+#ifdef CONFIG_RANDOM_TRUST_CPU
if (!__early_cpu_has_rndr() ||
!__arm64_rndr((unsigned long *)&seed))
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU
2022-08-17 9:46 [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU Andrea Righi
@ 2022-08-17 13:16 ` Mark Brown
2022-08-17 14:17 ` Andrea Righi
2022-08-17 13:51 ` Will Deacon
1 sibling, 1 reply; 4+ messages in thread
From: Mark Brown @ 2022-08-17 13:16 UTC (permalink / raw)
To: Andrea Righi
Cc: Catalin Marinas, Will Deacon, Greg Kroah-Hartman,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 791 bytes --]
On Wed, Aug 17, 2022 at 11:46:18AM +0200, Andrea Righi wrote:
> The CONFIG_ARCH_RANDOM .config option has been removed by
> commit 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM").
>
> Depend on CONFIG_RANDOM_TRUST_CPU to determine whether we can rely on
> __arm64_rndr() to initialize the seed for kaslr.
>
> Fixes: 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM")
> -#ifdef CONFIG_ARCH_RANDOM
> +#ifdef CONFIG_RANDOM_TRUST_CPU
> if (!__early_cpu_has_rndr() ||
> !__arm64_rndr((unsigned long *)&seed))
> #endif
I think the sense here would be more that we should just unconditionally
use RNDR if it's present - previously we'd use the result even if we
didn't have strong trust in the CPU implementation and I don't see why
we'd want to change that.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU
2022-08-17 13:16 ` Mark Brown
@ 2022-08-17 14:17 ` Andrea Righi
0 siblings, 0 replies; 4+ messages in thread
From: Andrea Righi @ 2022-08-17 14:17 UTC (permalink / raw)
To: Mark Brown
Cc: Catalin Marinas, Will Deacon, Greg Kroah-Hartman,
linux-arm-kernel, linux-kernel
On Wed, Aug 17, 2022 at 02:16:28PM +0100, Mark Brown wrote:
> On Wed, Aug 17, 2022 at 11:46:18AM +0200, Andrea Righi wrote:
> > The CONFIG_ARCH_RANDOM .config option has been removed by
> > commit 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM").
> >
> > Depend on CONFIG_RANDOM_TRUST_CPU to determine whether we can rely on
> > __arm64_rndr() to initialize the seed for kaslr.
> >
> > Fixes: 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM")
>
> > -#ifdef CONFIG_ARCH_RANDOM
> > +#ifdef CONFIG_RANDOM_TRUST_CPU
> > if (!__early_cpu_has_rndr() ||
> > !__arm64_rndr((unsigned long *)&seed))
> > #endif
>
> I think the sense here would be more that we should just unconditionally
> use RNDR if it's present - previously we'd use the result even if we
> didn't have strong trust in the CPU implementation and I don't see why
> we'd want to change that.
Makes sense, in that case it'd be better to just remove the guard
completely, as mentioned by Will.
Thanks,
-Andrea
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU
2022-08-17 9:46 [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU Andrea Righi
2022-08-17 13:16 ` Mark Brown
@ 2022-08-17 13:51 ` Will Deacon
1 sibling, 0 replies; 4+ messages in thread
From: Will Deacon @ 2022-08-17 13:51 UTC (permalink / raw)
To: Andrea Righi
Cc: Catalin Marinas, Greg Kroah-Hartman, linux-arm-kernel, linux-kernel
On Wed, Aug 17, 2022 at 11:46:18AM +0200, Andrea Righi wrote:
> The CONFIG_ARCH_RANDOM .config option has been removed by
> commit 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM").
>
> Depend on CONFIG_RANDOM_TRUST_CPU to determine whether we can rely on
> __arm64_rndr() to initialize the seed for kaslr.
>
> Fixes: 9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM")
> Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
> ---
> arch/arm64/kernel/pi/kaslr_early.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/kernel/pi/kaslr_early.c b/arch/arm64/kernel/pi/kaslr_early.c
> index 6c3855e69395..a1e6f90cb6e2 100644
> --- a/arch/arm64/kernel/pi/kaslr_early.c
> +++ b/arch/arm64/kernel/pi/kaslr_early.c
> @@ -94,7 +94,7 @@ asmlinkage u64 kaslr_early_init(void *fdt)
>
> seed = get_kaslr_seed(fdt);
> if (!seed) {
> -#ifdef CONFIG_ARCH_RANDOM
> +#ifdef CONFIG_RANDOM_TRUST_CPU
> if (!__early_cpu_has_rndr() ||
> !__arm64_rndr((unsigned long *)&seed))
> #endif
There was another patch sent for this which just removed the guard
altogether:
https://lore.kernel.org/r/20220721100433.18286-1-lukas.bulwahn@gmail.com
I was planning to pick that one up as a fix for -rc2 as Ard was happy
with it and it matches what Broonie was after as well.
Will
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-08-17 14:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-17 9:46 [PATCH] arm64: head: rely on CONFIG_RANDOM_TRUST_CPU Andrea Righi
2022-08-17 13:16 ` Mark Brown
2022-08-17 14:17 ` Andrea Righi
2022-08-17 13:51 ` 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).