Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6bec132c
Commit
6bec132c
authored
Feb 10, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Feb 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Try to handle write-watches while we're on the signal stack.
parent
18960643
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
9 deletions
+18
-9
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-1
signal_arm.c
dlls/ntdll/signal_arm.c
+1
-1
signal_arm64.c
dlls/ntdll/signal_arm64.c
+1
-1
signal_i386.c
dlls/ntdll/signal_i386.c
+10
-1
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+2
-2
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+1
-1
virtual.c
dlls/ntdll/virtual.c
+2
-2
No files found.
dlls/ntdll/ntdll_misc.h
View file @
6bec132c
...
...
@@ -169,7 +169,7 @@ extern NTSTATUS virtual_alloc_thread_stack( TEB *teb, SIZE_T reserve_size, SIZE_
extern
void
virtual_clear_thread_stack
(
void
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_handle_stack_fault
(
void
*
addr
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_is_valid_code_address
(
const
void
*
addr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_handle_fault
(
LPCVOID
addr
,
DWORD
err
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
virtual_handle_fault
(
LPCVOID
addr
,
DWORD
err
,
BOOL
on_signal_stack
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_check_buffer_for_read
(
const
void
*
ptr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
extern
BOOL
virtual_check_buffer_for_write
(
void
*
ptr
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
extern
SIZE_T
virtual_uninterrupted_read_memory
(
const
void
*
addr
,
void
*
buffer
,
SIZE_T
size
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/signal_arm.c
View file @
6bec132c
...
...
@@ -443,7 +443,7 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
if
(
rec
->
NumberParameters
==
2
)
{
if
(
!
(
rec
->
ExceptionCode
=
virtual_handle_fault
(
(
void
*
)
rec
->
ExceptionInformation
[
1
],
rec
->
ExceptionInformation
[
0
]
)))
rec
->
ExceptionInformation
[
0
]
,
FALSE
)))
goto
done
;
}
break
;
...
...
dlls/ntdll/signal_arm64.c
View file @
6bec132c
...
...
@@ -326,7 +326,7 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
if
(
rec
->
NumberParameters
==
2
)
{
if
(
!
(
rec
->
ExceptionCode
=
virtual_handle_fault
(
(
void
*
)
rec
->
ExceptionInformation
[
1
],
rec
->
ExceptionInformation
[
0
]
)))
rec
->
ExceptionInformation
[
0
]
,
FALSE
)))
goto
done
;
}
break
;
...
...
dlls/ntdll/signal_i386.c
View file @
6bec132c
...
...
@@ -1907,7 +1907,7 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
if
(
rec
->
ExceptionInformation
[
1
]
==
0xffffffff
&&
check_invalid_gs
(
context
))
goto
done
;
if
(
!
(
rec
->
ExceptionCode
=
virtual_handle_fault
(
(
void
*
)
rec
->
ExceptionInformation
[
1
],
rec
->
ExceptionInformation
[
0
]
)))
rec
->
ExceptionInformation
[
0
]
,
FALSE
)))
goto
done
;
if
(
rec
->
ExceptionCode
==
EXCEPTION_ACCESS_VIOLATION
&&
rec
->
ExceptionInformation
[
0
]
==
EXCEPTION_EXECUTE_FAULT
)
...
...
@@ -2046,6 +2046,15 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
ucontext_t
*
context
=
sigcontext
;
void
*
stack
=
init_handler
(
sigcontext
,
&
fs
,
&
gs
);
/* check for exceptions on the signal stack caused by write watches */
if
(
get_trap_code
(
context
)
==
TRAP_x86_PAGEFLT
&&
(
char
*
)
stack
>=
(
char
*
)
get_signal_stack
()
&&
(
char
*
)
stack
<
(
char
*
)
get_signal_stack
()
+
signal_stack_size
&&
!
virtual_handle_fault
(
siginfo
->
si_addr
,
(
get_error_code
(
context
)
>>
1
)
&
0x09
,
TRUE
))
{
return
;
}
/* check for page fault inside the thread stack */
if
(
get_trap_code
(
context
)
==
TRAP_x86_PAGEFLT
&&
(
char
*
)
siginfo
->
si_addr
>=
(
char
*
)
NtCurrentTeb
()
->
DeallocationStack
&&
...
...
dlls/ntdll/signal_powerpc.c
View file @
6bec132c
...
...
@@ -678,7 +678,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
rec
.
NumberParameters
=
2
;
rec
.
ExceptionInformation
[
0
]
=
0
;
/* FIXME ? */
rec
.
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
siginfo
->
si_addr
;
if
(
!
(
rec
.
ExceptionCode
=
virtual_handle_fault
(
siginfo
->
si_addr
,
rec
.
ExceptionInformation
[
0
])))
if
(
!
(
rec
.
ExceptionCode
=
virtual_handle_fault
(
siginfo
->
si_addr
,
rec
.
ExceptionInformation
[
0
]
,
FALSE
)))
goto
done
;
break
;
default:
...
...
@@ -701,7 +701,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
rec
.
NumberParameters
=
2
;
rec
.
ExceptionInformation
[
0
]
=
0
;
/* FIXME ? */
rec
.
ExceptionInformation
[
1
]
=
(
ULONG_PTR
)
siginfo
->
si_addr
;
if
(
!
(
rec
.
ExceptionCode
=
virtual_handle_fault
(
siginfo
->
si_addr
,
rec
.
ExceptionInformation
[
0
])))
if
(
!
(
rec
.
ExceptionCode
=
virtual_handle_fault
(
siginfo
->
si_addr
,
rec
.
ExceptionInformation
[
0
]
,
FALSE
)))
goto
done
;
break
;
#endif
...
...
dlls/ntdll/signal_x86_64.c
View file @
6bec132c
...
...
@@ -2286,7 +2286,7 @@ static void raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context )
if
(
rec
->
NumberParameters
==
2
)
{
if
(
!
(
rec
->
ExceptionCode
=
virtual_handle_fault
(
(
void
*
)
rec
->
ExceptionInformation
[
1
],
rec
->
ExceptionInformation
[
0
]
)))
rec
->
ExceptionInformation
[
0
]
,
FALSE
)))
set_cpu_context
(
context
);
}
break
;
...
...
dlls/ntdll/virtual.c
View file @
6bec132c
...
...
@@ -1521,7 +1521,7 @@ void virtual_clear_thread_stack(void)
/***********************************************************************
* virtual_handle_fault
*/
NTSTATUS
virtual_handle_fault
(
LPCVOID
addr
,
DWORD
err
)
NTSTATUS
virtual_handle_fault
(
LPCVOID
addr
,
DWORD
err
,
BOOL
on_signal_stack
)
{
struct
file_view
*
view
;
NTSTATUS
ret
=
STATUS_ACCESS_VIOLATION
;
...
...
@@ -1542,7 +1542,7 @@ NTSTATUS virtual_handle_fault( LPCVOID addr, DWORD err )
/* ignore fault if page is writable now */
if
(
VIRTUAL_GetUnixProt
(
*
vprot
)
&
PROT_WRITE
)
ret
=
STATUS_SUCCESS
;
}
if
(
*
vprot
&
VPROT_GUARD
)
if
(
!
on_signal_stack
&&
(
*
vprot
&
VPROT_GUARD
)
)
{
VIRTUAL_SetProt
(
view
,
page
,
page_size
,
*
vprot
&
~
VPROT_GUARD
);
ret
=
STATUS_GUARD_PAGE_VIOLATION
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment