From 8e3da826f6c929a30dc156009b0b7912bd79564d Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Thu, 7 Feb 2013 09:44:13 -0800 Subject: [PATCH] --- yaml --- r: 349728 b: refs/heads/master c: e575a86fdc50d013bf3ad3aa81d9100e8e6cc60d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/mm/fault.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 999a024f4beb..24300430765d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bb9b1a834f7a916a65ba64f4812078cfbe2f4fc4 +refs/heads/master: e575a86fdc50d013bf3ad3aa81d9100e8e6cc60d diff --git a/trunk/arch/x86/mm/fault.c b/trunk/arch/x86/mm/fault.c index 027088f2f7dd..fb674fd3fc22 100644 --- a/trunk/arch/x86/mm/fault.c +++ b/trunk/arch/x86/mm/fault.c @@ -748,13 +748,15 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code, return; } #endif + /* Kernel addresses are always protection faults: */ + if (address >= TASK_SIZE) + error_code |= PF_PROT; - if (unlikely(show_unhandled_signals)) + if (likely(show_unhandled_signals)) show_signal_msg(regs, error_code, address, tsk); - /* Kernel addresses are always protection faults: */ tsk->thread.cr2 = address; - tsk->thread.error_code = error_code | (address >= TASK_SIZE); + tsk->thread.error_code = error_code; tsk->thread.trap_nr = X86_TRAP_PF; force_sig_info_fault(SIGSEGV, si_code, address, tsk, 0);