From 4bc0a428bd89efaf8021b5c76ec85db56364056e Mon Sep 17 00:00:00 2001 From: Cue Gaosheng Date: Wed, 10 Aug 2022 17:28:04 +0800 Subject: [PATCH] arm64: test security features ohos inclusion category: feature issue: #I5HVRJ CVE: NA --------------------------------------- Add debug info to test security features, such as kaslr, vendor hooks. Signed-off-by: Cue Gaosheng --- arch/arm64/kernel/kaslr.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/kaslr.c b/arch/arm64/kernel/kaslr.c index b181e0544b79..2b04378ccf95 100644 --- a/arch/arm64/kernel/kaslr.c +++ b/arch/arm64/kernel/kaslr.c @@ -38,12 +38,21 @@ static __init u64 get_kaslr_seed(void *fdt) u64 ret; node = fdt_path_offset(fdt, "/chosen"); - if (node < 0) + if (node < 0) { + pr_info("KASLR get_kaslr_seed no chosen\n"); return 0; + } prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len); - if (!prop || len != sizeof(u64)) + if (!prop) { + pr_info("KASLR get_kaslr_seed no kaslr-seed\n"); return 0; + } + + if (len != sizeof(u64)) { + pr_info("KASLR get_kaslr_seed kaslr-seed len not u64\n"); + return 0; + } ret = fdt64_to_cpu(*prop); *prop = 0; -- Gitee