• Sean Christopherson's avatar
    x86/fault: Reword initial BUG message for unhandled page faults · f28b11a2
    Sean Christopherson authored
    Reword the NULL pointer dereference case to simply state that a NULL
    pointer was dereferenced, i.e. drop "unable to handle" as that implies
    that there are instances where the kernel actual does handle NULL
    pointer dereferences, which is not true barring funky exception fixup.
    
    For the non-NULL case, replace "kernel paging request" with "page fault"
    as the kernel can technically oops on faults that originated in user
    code.  Dropping "kernel" also allows future patches to provide detailed
    information on where the fault occurred, e.g. user vs. kernel, without
    conflicting with the initial BUG message.
    
    In both cases, replace "at address=" with wording more appropriate to
    the oops, as "at" may be interpreted as stating that the address is the
    RIP of the instruction that faulted.
    
    Last, and probably least, further qualify the NULL-pointer path by
    checking that the fault actually originated in kernel code.  It's
    technically possible for userspace to map address 0, and not printing
    a super specific message is the least of our worries if the kernel does
    manage to oops on an actual NULL pointer dereference from userspace.
    
    Before:
        BUG: unable to handle kernel NULL pointer dereference at ffffbeef00000000
        BUG: unable to handle kernel paging request at ffffbeef00000000
    
    After:
        BUG: kernel NULL pointer dereference, address = 0000000000000008
        BUG: unable to handle page fault for address = ffffbeef00000000
    Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
    Cc: Andy Lutomirski <luto@kernel.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rik van Riel <riel@surriel.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Yu-cheng Yu <yu-cheng.yu@intel.com>
    Link: http://lkml.kernel.org/r/20181221213657.27628-2-sean.j.christopherson@intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    f28b11a2
fault.c 40.7 KB