Re: [RFC PATCH v1 39/50] arm: kexec_file: Avoid temp buffer for RNG seed

From: Will Deacon
Date: Mon Mar 30 2020 - 09:37:08 EST


On Tue, Dec 10, 2019 at 10:45:27AM -0500, George Spelvin wrote:
> After using get_random_bytes(), you want to wipe the buffer
> afterward so the seed remains secret.
>
> In this case, we can eliminate the temporary buffer entirely.
> fdt_setprop_placeholder returns a pointer to the property value
> buffer, allowing us to put the random data directy in there without

s/directy/directly/

> using a temporary buffer at all. Faster and less stack all in one.
>
> Signed-off-by: George Spelvin <lkml@xxxxxxx>
> Cc: Hsin-Yi Wang <hsinyi@xxxxxxxxxxxx>
> Cc: Catalin Marinas <catalin.marinas@xxxxxxx>
> Cc: Will Deacon <will@xxxxxxxxxx>
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> ---
> arch/arm64/kernel/machine_kexec_file.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)

Acked-by: Will Deacon <will@xxxxxxxxxx>

Please let me know if you'd like this queued via the arm64 tree, as it
appears to be independent of the rest of this series.

Will