* [PATCH] x86/mm/dump_pagetables: Check PAGE_PRESENT for real
@ 2017-12-16 0:59 Thomas Gleixner
0 siblings, 0 replies; only message in thread
From: Thomas Gleixner @ 2017-12-16 0:59 UTC (permalink / raw)
To: LKML; +Cc: x86, Peter Zijlstra, Dave Hansen, keescook
The check for a present page in printk_prot():
if (!pgprot_val(prot)) {
/* Not present */
is bogus. If a PTE is set to PAGE_NONE then the pgprot_val is not zero and
the entry is decoded in bogus ways, e.g. as RX GLB. That is confusing when
analyzing mapping correctness. Check for the present bit to make an
informed decision.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/mm/dump_pagetables.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/x86/mm/dump_pagetables.c
+++ b/arch/x86/mm/dump_pagetables.c
@@ -140,7 +140,7 @@ static void printk_prot(struct seq_file
static const char * const level_name[] =
{ "cr3", "pgd", "p4d", "pud", "pmd", "pte" };
- if (!pgprot_val(prot)) {
+ if (!(pgprot_val(prot) & _PAGE_PRESENT)) {
/* Not present */
pt_dump_cont_printf(m, dmsg, " ");
} else {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-12-16 0:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-16 0:59 [PATCH] x86/mm/dump_pagetables: Check PAGE_PRESENT for real Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®