* [PATCH] arm64: kexec_file: return successfully even if kaslr-seed doesn't exist
@ 2019-01-11 7:40 AKASHI Takahiro
2019-01-11 15:33 ` James Morse
0 siblings, 1 reply; 2+ messages in thread
From: AKASHI Takahiro @ 2019-01-11 7:40 UTC (permalink / raw)
To: catalin.marinas, will.deacon; +Cc: AKASHI Takahiro, kexec, linux-arm-kernel
In kexec_file_load, kaslr-seed property of the current dtb will be deleted
any way before setting a new value if possible. It doesn't matter whether
it exists in the current dtb.
So "ret" should be reset to 0 here.
Fixes: commit 884143f60c89 ("arm64: kexec_file: add kaslr support")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
arch/arm64/kernel/machine_kexec_file.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c
index 10e33860e47a..f2c211a6229b 100644
--- a/arch/arm64/kernel/machine_kexec_file.c
+++ b/arch/arm64/kernel/machine_kexec_file.c
@@ -87,7 +87,9 @@ static int setup_dtb(struct kimage *image,
/* add kaslr-seed */
ret = fdt_delprop(dtb, off, FDT_PROP_KASLR_SEED);
- if (ret && (ret != -FDT_ERR_NOTFOUND))
+ if (ret == -FDT_ERR_NOTFOUND)
+ ret = 0;
+ else if (ret)
goto out;
if (rng_is_initialized()) {
--
2.19.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: kexec_file: return successfully even if kaslr-seed doesn't exist
2019-01-11 7:40 [PATCH] arm64: kexec_file: return successfully even if kaslr-seed doesn't exist AKASHI Takahiro
@ 2019-01-11 15:33 ` James Morse
0 siblings, 0 replies; 2+ messages in thread
From: James Morse @ 2019-01-11 15:33 UTC (permalink / raw)
To: AKASHI Takahiro; +Cc: catalin.marinas, will.deacon, kexec, linux-arm-kernel
Hi Akashi,
On 11/01/2019 07:40, AKASHI Takahiro wrote:
> In kexec_file_load, kaslr-seed property of the current dtb will be deleted
> any way before setting a new value if possible. It doesn't matter whether
> it exists in the current dtb.
Could you describe what goes wrong without this patch?
If the rng isn't ready yet, this stale error causes us to return an error,
causing kexec_file_load() to fail unnecessarily.
> So "ret" should be reset to 0 here.
>
> Fixes: commit 884143f60c89 ("arm64: kexec_file: add kaslr support")
Reviewed-by: James Morse <james.morse@arm.com>
Thanks!
James
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-11 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 7:40 [PATCH] arm64: kexec_file: return successfully even if kaslr-seed doesn't exist AKASHI Takahiro
2019-01-11 15:33 ` James Morse
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).