From 52edd75661b6724c85f76a372f4c3f508554d202 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 19 Sep 2007 11:37:14 -0700 Subject: [PATCH] --- yaml --- r: 65038 b: refs/heads/master c: dbe3ed1c078c193be34326728d494c5c4bc115e2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86_64/mm/fault.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 07b6356fda40..95de55a78ada 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f01a757e75f2a3cab2bab89c4176498963946b9 +refs/heads/master: dbe3ed1c078c193be34326728d494c5c4bc115e2 diff --git a/trunk/arch/x86_64/mm/fault.c b/trunk/arch/x86_64/mm/fault.c index 327c9f2fa626..54816adb8e93 100644 --- a/trunk/arch/x86_64/mm/fault.c +++ b/trunk/arch/x86_64/mm/fault.c @@ -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