]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
arm64: Don't walk page table for user faults in do_mem_abort
authorWill Deacon <will.deacon@arm.com>
Tue, 31 Oct 2017 15:56:11 +0000 (15:56 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 2 Nov 2017 13:52:48 +0000 (13:52 +0000)
Commit 42dbf54e8890 ("arm64: consistently log ESR and page table")
dumps page table entries for user faults hitting do_bad entries in the
fault handler table. Whilst this shouldn't really happen in practice,
it's not beyond the realms of possibility if e.g. running an old kernel
on a new CPU.

Generally, we want to avoid exposing physical addresses under the control
of userspace (see commit bf396c09c24 ("arm64: mm: don't print out page
table entries on EL0 faults")), so walk the page tables only on exceptions
from EL1.

Reported-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/fault.c

index 6ee22cd8a24940ce657c45378ff6879709fad144..a2a1a6c83da19806e7d4712c5cd508e01ed6f470 100644 (file)
@@ -698,7 +698,8 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
 
        mem_abort_decode(esr);
 
-       show_pte(addr);
+       if (!user_mode(regs))
+               show_pte(addr);
 
        info.si_signo = inf->sig;
        info.si_errno = 0;