[haiku-commits] haiku: hrev52346 - src/system/kernel/arch/x86

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 14 Sep 2018 06:09:13 -0400 (EDT)

hrev52346 adds 1 changeset to branch 'master'
old head: 8c005190c455f3722c64a6ffc7dece9020da7258
new head: 99888f6b696f3bf5e10adc3822e146ffe7098bf0
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=99888f6b696f+%5E8c005190c455

----------------------------------------------------------------------------

99888f6b696f: kernel: Apply user iframe determination logic to SMAP/SMEP.
  
  Change-Id: I394492a289f01303ac28e6d6670fbfdb326fa4db
  Reviewed-on: https://review.haiku-os.org/561
  Reviewed-by: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>

                                            [ Michael Lotz <mmlr@xxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev52346
Commit:      99888f6b696f3bf5e10adc3822e146ffe7098bf0
URL:         https://git.haiku-os.org/haiku/commit/?id=99888f6b696f
Author:      Michael Lotz <mmlr@xxxxxxxx>
Date:        Thu Sep 13 20:55:05 2018 UTC
Committer:   Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Commit-Date: Fri Sep 14 10:09:10 2018 UTC

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 2 deletions(-)
src/system/kernel/arch/x86/arch_int.cpp | 4 ++--

----------------------------------------------------------------------------

diff --git a/src/system/kernel/arch/x86/arch_int.cpp 
b/src/system/kernel/arch/x86/arch_int.cpp
index 1771dcc4ce..5588d5d181 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -327,7 +327,7 @@ x86_page_fault_exception(struct iframe* frame)
                panic("page fault not allowed at this place. Touching address "
                        "%p from ip %p\n", (void*)cr2, (void*)frame->ip);
                return;
-       } else if ((frame->error_code & PGFAULT_U) == 0
+       } else if (!IFRAME_IS_USER(frame)
                && (frame->error_code & PGFAULT_I) != 0
                && (x86_read_cr4() & IA32_CR4_SMEP) != 0) {
                // check that: 1. come not from userland,
@@ -335,7 +335,7 @@ x86_page_fault_exception(struct iframe* frame)
                panic("SMEP violation user-mapped address %p touched from 
kernel %p\n",
                        (void*)cr2, (void*)frame->ip);
        } else if ((frame->flags & X86_EFLAGS_ALIGNMENT_CHECK) == 0
-               && (frame->error_code & PGFAULT_U) == 0
+               && !IFRAME_IS_USER(frame)
                && (frame->error_code & PGFAULT_P) != 0
                && (x86_read_cr4() & IA32_CR4_SMAP) != 0) {
                // check that: 1. AC flag is not set, 2. come not from userland,


Other related posts:

  • » [haiku-commits] haiku: hrev52346 - src/system/kernel/arch/x86 - Axel Dörfler