From: Greg Kroah-Hartman Date: Thu, 30 Jun 2022 12:06:54 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.9.321~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af20c27d1fe1e85d66f9e5bfe5f548c24c11f0fe;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: fdt-update-crc-check-for-rng-seed.patch --- diff --git a/queue-4.19/fdt-update-crc-check-for-rng-seed.patch b/queue-4.19/fdt-update-crc-check-for-rng-seed.patch new file mode 100644 index 00000000000..b2d18fbff19 --- /dev/null +++ b/queue-4.19/fdt-update-crc-check-for-rng-seed.patch @@ -0,0 +1,61 @@ +From dd753d961c4844a39f947be115b3d81e10376ee5 Mon Sep 17 00:00:00 2001 +From: Hsin-Yi Wang +Date: Tue, 27 Aug 2019 18:33:53 +0800 +Subject: fdt: Update CRC check for rng-seed + +From: Hsin-Yi Wang + +commit dd753d961c4844a39f947be115b3d81e10376ee5 upstream. + +Commit 428826f5358c ("fdt: add support for rng-seed") moves of_fdt_crc32 +from early_init_dt_verify() to early_init_dt_scan() since +early_init_dt_scan_chosen() may modify fdt to erase rng-seed. + +However, arm and some other arch won't call early_init_dt_scan(), they +call early_init_dt_verify() then early_init_dt_scan_nodes(). + +Restore of_fdt_crc32 to early_init_dt_verify() then update it in +early_init_dt_scan_chosen() if fdt if updated. + +Fixes: 428826f5358c ("fdt: add support for rng-seed") +Reported-by: Geert Uytterhoeven +Signed-off-by: Hsin-Yi Wang +Tested-by: Geert Uytterhoeven +Signed-off-by: Will Deacon +Signed-off-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + drivers/of/fdt.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -1119,6 +1119,10 @@ int __init early_init_dt_scan_chosen(uns + + /* try to clear seed so it won't be found. */ + fdt_nop_property(initial_boot_params, node, "rng-seed"); ++ ++ /* update CRC check value */ ++ of_fdt_crc32 = crc32_be(~0, initial_boot_params, ++ fdt_totalsize(initial_boot_params)); + } + + /* break now */ +@@ -1223,6 +1227,8 @@ bool __init early_init_dt_verify(void *p + + /* Setup flat device-tree pointer */ + initial_boot_params = params; ++ of_fdt_crc32 = crc32_be(~0, initial_boot_params, ++ fdt_totalsize(initial_boot_params)); + return true; + } + +@@ -1248,8 +1254,6 @@ bool __init early_init_dt_scan(void *par + return false; + + early_init_dt_scan_nodes(); +- of_fdt_crc32 = crc32_be(~0, initial_boot_params, +- fdt_totalsize(initial_boot_params)); + return true; + } + diff --git a/queue-4.19/series b/queue-4.19/series index 929b58a48e3..1f499ebf3cf 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -43,3 +43,4 @@ powerpc-pseries-wire-up-rng-during-setup_arch.patch drm-remove-drm_fb_helper_modinit.patch xen-unexport-__init-annotated-xen_xlate_map_ballooned_pages.patch xen-gntdev-avoid-blocking-in-unmap_grant_pages.patch +fdt-update-crc-check-for-rng-seed.patch