hrev52345 adds 1 changeset to branch 'master'
old head: 0de5a83940e56b9f9b910e8550d0f64c45362cff
new head: 8c005190c455f3722c64a6ffc7dece9020da7258
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=8c005190c455+%5E0de5a83940e5
----------------------------------------------------------------------------
8c005190c455: kernel: Determine kernel vs. user page fault depending on iframe.
The action vm_page_fault takes should depend on whether the iframe to be
handled is a user iframe or not. The check for the user flag in the
error code does however only check if the fault happend in user or
kernel space. Use IFRAME_IS_USER() instead which checks the privilege
level of the iframe. Under 32 bit x86 this also handles vm86
compatibility mode properly.
This is the same logic as used on FreeBSD (TRAPF_USERMODE).
Fixes #13930.
Change-Id: I9c348b6ab4c60daaaaa2c0fe33bcc3336aa29f7b
Reviewed-on: https://review.haiku-os.org/560
Reviewed-by: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
[ Michael Lotz <mmlr@xxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev52345
Commit: 8c005190c455f3722c64a6ffc7dece9020da7258
URL: https://git.haiku-os.org/haiku/commit/?id=8c005190c455
Author: Michael Lotz <mmlr@xxxxxxxx>
Date: Fri Apr 6 19:33:10 2018 UTC
Committer: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
Commit-Date: Fri Sep 14 10:08:03 2018 UTC
Ticket: https://dev.haiku-os.org/ticket/13930
----------------------------------------------------------------------------
1 file changed, 1 insertion(+), 1 deletion(-)
src/system/kernel/arch/x86/arch_int.cpp | 2 +-
----------------------------------------------------------------------------
diff --git a/src/system/kernel/arch/x86/arch_int.cpp
b/src/system/kernel/arch/x86/arch_int.cpp
index fe23614d48..1771dcc4ce 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -349,7 +349,7 @@ x86_page_fault_exception(struct iframe* frame)
vm_page_fault(cr2, frame->ip,
(frame->error_code & PGFAULT_W) != 0, // write access
(frame->error_code & PGFAULT_I) != 0, // instruction
fetch
- (frame->error_code & PGFAULT_U) != 0, // userland
+ IFRAME_IS_USER(frame),
// userland
&newip);
if (newip != 0) {
// the page fault handler wants us to modify the iframe to set
the