diff options
author | Matt Fleming <matt.fleming@intel.com> | 2013-12-06 16:13:04 -0500 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2014-03-04 16:23:36 -0500 |
commit | 426e34cc4f6094cefe4f3175764cdf583128e7cd (patch) | |
tree | e8dab070cd83c3064cd91db25017386fea3c8877 /arch/x86/mm/fault.c | |
parent | 993c30a04e205fb239c0875b25b43ddef0499845 (diff) |
x86/mm/pageattr: Always dump the right page table in an oops
Now that we have EFI-specific page tables we need to lookup the pgd when
dumping those page tables, rather than assuming that swapper_pgdir is
the current pgdir.
Remove the double underscore prefix, which is usually reserved for
static functions.
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'arch/x86/mm/fault.c')
-rw-r--r-- | arch/x86/mm/fault.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 6dea040cc3a1..6055a2001b27 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c | |||
@@ -584,8 +584,13 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, | |||
584 | 584 | ||
585 | if (error_code & PF_INSTR) { | 585 | if (error_code & PF_INSTR) { |
586 | unsigned int level; | 586 | unsigned int level; |
587 | pgd_t *pgd; | ||
588 | pte_t *pte; | ||
587 | 589 | ||
588 | pte_t *pte = lookup_address(address, &level); | 590 | pgd = __va(read_cr3() & PHYSICAL_PAGE_MASK); |
591 | pgd += pgd_index(address); | ||
592 | |||
593 | pte = lookup_address_in_pgd(pgd, address, &level); | ||
589 | 594 | ||
590 | if (pte && pte_present(*pte) && !pte_exec(*pte)) | 595 | if (pte && pte_present(*pte) && !pte_exec(*pte)) |
591 | printk(nx_warning, from_kuid(&init_user_ns, current_uid())); | 596 | printk(nx_warning, from_kuid(&init_user_ns, current_uid())); |