[Crash-utility] [RFC PATCH 6/9] diskdump: Make sanity check in cache_page() strict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make sanity check in cache_page() strict using function
sanity_check_page_desc().

This sanity check is performed each time cache_page() read a single
entry of page descriptor table. For users who are interested in a
whole part of page descriptor table, suggest to use
--validate_kdump_headers command-line option.
---
 diskdump.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/diskdump.c b/diskdump.c
index 9a94e7e..db96fdb 100644
--- a/diskdump.c
+++ b/diskdump.c
@@ -1235,8 +1235,14 @@ cache_page(physaddr_t paddr)
 		return ret;
 
 	/* sanity check */
-	if (pd.size > block_size)
+	if (!sanity_check_page_desc(&pd)) {
+		error(INFO, "%s: invalid page descriptor found: paddr/pfn: %llx/%lx\n"
+		      "Use --validate_kdump_headers command line option to "
+		      "validate a whole part of page descriptor table\n",
+		      DISKDUMP_VALID() ? "diskdump" : "compressed kdump",
+		      (ulonglong)paddr, pfn);
 		return READ_ERROR;
+	}
 
 	/* read page data */
 	if (FLAT_FORMAT()) {
-- 
2.43.1
--
Crash-utility mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxxxxxx
https://${domain_name}/admin/lists/devel.lists.crash-utility.osci.io/
Contribution Guidelines: https://github.com/crash-utility/crash/wiki




[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux