init: panic the kernel when compare the ramdisk hash failed

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I362eda9782f661d5faef85a773c358ad26fd4dcd
This commit is contained in:
Jason Zhu
2021-03-09 17:13:01 +08:00
committed by Tao Huang
parent 048b3bf402
commit e596cd7c88

View File

@@ -458,6 +458,12 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len)
state = Start;
this_header = 0;
message = NULL;
#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT_CRYPTO
if (rk_tb_crypto_sha256_wait_compare_done())
panic("Timeout, campare the sha256 digest fail, the ramdisk is untrusted.\n");
#endif
#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT) && defined(CONFIG_ROCKCHIP_HW_DECOMPRESS) && defined(CONFIG_INITRD_ASYNC)
wait_initrd_hw_decom_done();
#endif