From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Hsin-Yi Wang <hsinyi@chromium.org>, Will Deacon <will@kernel.org>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 4.9 27/29] fdt: Update CRC check for rng-seed
Date: Thu, 30 Jun 2022 15:46:27 +0200 [thread overview]
Message-ID: <20220630133232.001721917@linuxfoundation.org> (raw)
In-Reply-To: <20220630133231.200642128@linuxfoundation.org>
From: Hsin-Yi Wang <hsinyi@chromium.org>
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 <geert+renesas@glider.be>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/of/fdt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1110,6 +1110,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 */
@@ -1213,6 +1217,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;
}
@@ -1238,8 +1244,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;
}
next prev parent reply other threads:[~2022-06-30 13:49 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 13:46 [PATCH 4.9 00/29] 4.9.321-rc1 review Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 01/29] vt: drop old FONT ioctls Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 02/29] random: schedule mix_interrupt_randomness() less often Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 03/29] ata: libata: add qc->flags in ata_qc_complete_template tracepoint Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 04/29] dm era: commit metadata in postsuspend after worker stops Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 05/29] random: quiet urandom warning ratelimit suppression message Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 06/29] USB: serial: option: add Telit LE910Cx 0x1250 composition Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 07/29] bonding: ARP monitor spams NETDEV_NOTIFY_PEERS notifiers Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 08/29] x86/xen: Remove undefined behavior in setup_features() Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 09/29] MIPS: Remove repetitive increase irq_err_count Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 10/29] igb: Make DMA faster when CPU is active on the PCIe link Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 11/29] iio: adc: vf610: fix conversion mode sysfs node name Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 12/29] usb: chipidea: udc: check request status before setting device address Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 13/29] iio:accel:bma180: rearrange iio trigger get and register Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 14/29] iio: accel: mma8452: ignore the return value of reset operation Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 15/29] iio: trigger: sysfs: fix use-after-free on remove Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 16/29] xtensa: xtfpga: Fix refcount leak bug in setup Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 17/29] xtensa: Fix refcount leak bug in time.c Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 18/29] powerpc: Enable execve syscall exit tracepoint Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 19/29] ARM: dts: imx6qdl: correct PU regulator ramp delay Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 20/29] ARM: exynos: Fix refcount leak in exynos_map_pmu Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 21/29] ARM: Fix refcount leak in axxia_boot_secondary Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 22/29] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 23/29] modpost: fix section mismatch check for exported init/exit sections Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 24/29] powerpc/pseries: wire up rng during setup_arch() Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 25/29] drm: remove drm_fb_helper_modinit Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 26/29] xen: unexport __init-annotated xen_xlate_map_ballooned_pages() Greg Kroah-Hartman
2022-06-30 13:46 ` Greg Kroah-Hartman [this message]
2022-06-30 13:46 ` [PATCH 4.9 28/29] kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] Greg Kroah-Hartman
2022-06-30 13:46 ` [PATCH 4.9 29/29] swiotlb: skip swiotlb_bounce when orig_addr is zero Greg Kroah-Hartman
2022-06-30 17:09 ` [PATCH 4.9 00/29] 4.9.321-rc1 review Jon Hunter
2022-06-30 23:06 ` Shuah Khan
2022-06-30 23:57 ` Florian Fainelli
2022-07-01 0:56 ` Guenter Roeck
2022-07-01 8:24 ` Naresh Kamboju
2022-07-01 18:45 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220630133232.001721917@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=f.fainelli@gmail.com \
--cc=geert+renesas@glider.be \
--cc=hsinyi@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox