summaryrefslogtreecommitdiff
path: root/drivers/of/address.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2022-11-28 23:24:39 +0300
committerRob Herring <robh@kernel.org>2022-12-06 23:50:36 +0300
commite553ad8d7957697385e81034bf76db3b2cb2cf27 (patch)
treeb165293e507803a2b179b5ac11dd5d768cf0d939 /drivers/of/address.c
parent93266da2409b1709474be00f1becbbdaddb2b706 (diff)
downloadlinux-e553ad8d7957697385e81034bf76db3b2cb2cf27.tar.xz
of/kexec: Fix reading 32-bit "linux,initrd-{start,end}" values
"linux,initrd-start" and "linux,initrd-end" can be 32-bit values even on a 64-bit platform. Ideally, the size should be based on '#address-cells', but that has never been enforced in the kernel's FDT boot parsing code (early_init_dt_check_for_initrd()). Bootloader behavior is known to vary. For example, kexec always writes these as 64-bit. The result of incorrectly reading 32-bit values is most likely the reserved memory for the original initrd will still be reserved for the new kernel. The original arm64 equivalent of this code failed to release the initrd reserved memory in *all* cases. Use of_read_number() to mirror the early_init_dt_check_for_initrd() code. Fixes: b30be4dc733e ("of: Add a common kexec FDT setup function") Cc: stable@vger.kernel.org Reported-by: Peter Maydell <peter.maydell@linaro.org> Link: https://lore.kernel.org/r/20221128202440.1411895-1-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/address.c')
0 files changed, 0 insertions, 0 deletions