diff options
author | Dave Hansen <[email protected]> | 2018-09-28 09:02:25 -0700 |
---|---|---|
committer | Peter Zijlstra <[email protected]> | 2018-10-09 16:51:16 +0200 |
commit | 5b0c2cac54d44ea40d5c5aec7cbf14353b2a903e (patch) | |
tree | 6b6ad59f522d8bbacd38a200b3eba413be345f8f | |
parent | aa37c51b9421d66f7931c5fdcb9ce80c450974be (diff) |
x86/mm: Add clarifying comments for user addr space
The SMAP and Reserved checking do not have nice comments. Add
some to clarify and make it match everything else.
Cc: [email protected]
Cc: Jann Horn <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
-rw-r--r-- | arch/x86/mm/fault.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 0d1f5d39fc63..1d838701a5f7 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -1276,9 +1276,17 @@ void do_user_addr_fault(struct pt_regs *regs, if (unlikely(kprobes_fault(regs))) return; + /* + * Reserved bits are never expected to be set on + * entries in the user portion of the page tables. + */ if (unlikely(hw_error_code & X86_PF_RSVD)) pgtable_bad(regs, hw_error_code, address); + /* + * Check for invalid kernel (supervisor) access to user + * pages in the user address space. + */ if (unlikely(smap_violation(hw_error_code, regs))) { bad_area_nosemaphore(regs, hw_error_code, address, NULL); return; |