Commit 5b0c2cac authored by Dave Hansen's avatar Dave Hansen Committed by Peter Zijlstra
Browse files

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: x86@kernel.org
Cc: Jann Horn <jannh@google.com>
Cc: Sean Christopherson <sean.j.christopherson@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Andy Lutomirski <luto@kernel.org>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180928160225.FFD44B8D@viggo.jf.intel.com
parent aa37c51b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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;