From b6e6912193ec519a87d65ceb36d6c29443aed2ef Mon Sep 17 00:00:00 2001 From: Neeraj Upadhyay Date: Thu, 30 Jul 2020 16:05:44 +0530 Subject: [PATCH] Minidump: Dump only accessible pages data Check for accessible pages, before capturing the page context, while dumping pointer data, for CPU registers. Change-Id: If7f38f0e3cb12e5c0ad85f8ed3140ce098108f62 Signed-off-by: Neeraj Upadhyay --- drivers/soc/qcom/minidump_log.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/minidump_log.c b/drivers/soc/qcom/minidump_log.c index f96355cba02e..06a5b438b40e 100644 --- a/drivers/soc/qcom/minidump_log.c +++ b/drivers/soc/qcom/minidump_log.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -830,10 +831,14 @@ static void md_dump_data(unsigned long addr, int nbytes, const char *name) for (j = 0; j < 8; j++) { u32 data; - if (probe_kernel_address(p, data)) - seq_buf_printf(md_cntxt_seq_buf, " ********"); + if (__is_lm_address(p) && + kern_addr_valid((unsigned long)p) && + page_accessible(page_to_pfn(virt_to_page(p))) && + !probe_kernel_address(p, data)) + seq_buf_printf(md_cntxt_seq_buf, " %08x", + data); else - seq_buf_printf(md_cntxt_seq_buf, " %08x", data); + seq_buf_printf(md_cntxt_seq_buf, " ********"); ++p; } seq_buf_printf(md_cntxt_seq_buf, "\n");