]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86_64/mm/fault.c
x86-64: page faults from user mode are always user faults
[linux-2.6-omap-h63xx.git] / arch / x86_64 / mm / fault.c
index 327c9f2fa6269f3020f94f856cd8e0b8b36ab494..54816adb8e933c8c09e41afcf3008331afb5adc6 100644 (file)
@@ -374,6 +374,13 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs,
        if (unlikely(in_atomic() || !mm))
                goto bad_area_nosemaphore;
 
+       /*
+        * User-mode registers count as a user access even for any
+        * potential system fault or CPU buglet.
+        */
+       if (user_mode_vm(regs))
+               error_code |= PF_USER;
+
  again:
        /* When running in the kernel we expect faults to occur only to
         * addresses in user space.  All other faults represent errors in the