Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
98238aa8
Commit
98238aa8
authored
Oct 16, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Disallow changing DEP flags on 64-bit.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
41374ef1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
process.c
dlls/ntdll/process.c
+4
-2
exception.c
dlls/ntdll/tests/exception.c
+18
-1
No files found.
dlls/ntdll/process.c
View file @
98238aa8
...
...
@@ -57,7 +57,9 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
process
);
static
ULONG
execute_flags
=
MEM_EXECUTE_OPTION_DISABLE
;
static
ULONG
execute_flags
=
MEM_EXECUTE_OPTION_DISABLE
|
(
sizeof
(
void
*
)
>
sizeof
(
int
)
?
MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION
|
MEM_EXECUTE_OPTION_PERMANENT
:
0
);
static
const
BOOL
is_win64
=
(
sizeof
(
void
*
)
>
sizeof
(
int
));
...
...
@@ -679,7 +681,7 @@ NTSTATUS WINAPI NtSetInformationProcess(
break
;
case
ProcessExecuteFlags
:
if
(
ProcessInformationLength
!=
sizeof
(
ULONG
))
if
(
is_win64
||
ProcessInformationLength
!=
sizeof
(
ULONG
))
return
STATUS_INVALID_PARAMETER
;
else
if
(
execute_flags
&
MEM_EXECUTE_OPTION_PERMANENT
)
return
STATUS_ACCESS_DENIED
;
...
...
dlls/ntdll/tests/exception.c
View file @
98238aa8
...
...
@@ -170,6 +170,7 @@ static char** my_argv;
#define ProcessExecuteFlags 0x22
#define MEM_EXECUTE_OPTION_DISABLE 0x01
#define MEM_EXECUTE_OPTION_ENABLE 0x02
#define MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION 0x04
#define MEM_EXECUTE_OPTION_PERMANENT 0x08
#endif
...
...
@@ -2575,9 +2576,25 @@ static void test_dpe_exceptions(void)
{
static
const
BYTE
ret
[]
=
{
0xc3
};
DWORD
(
CDECL
*
func
)(
void
)
=
code_mem
;
DWORD
old_prot
;
DWORD
old_prot
,
val
=
0
,
len
=
0xdeadbeef
;
NTSTATUS
status
;
void
*
handler
;
status
=
pNtQueryInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_INVALID_PARAMETER
,
"got status %08x
\n
"
,
status
);
if
(
!
status
)
{
ok
(
len
==
sizeof
(
val
),
"wrong len %u
\n
"
,
len
);
ok
(
val
==
(
MEM_EXECUTE_OPTION_DISABLE
|
MEM_EXECUTE_OPTION_PERMANENT
|
MEM_EXECUTE_OPTION_DISABLE_THUNK_EMULATION
),
"wrong val %08x
\n
"
,
val
);
}
else
ok
(
len
==
0xdeadbeef
,
"wrong len %u
\n
"
,
len
);
val
=
MEM_EXECUTE_OPTION_DISABLE
;
status
=
pNtSetInformationProcess
(
GetCurrentProcess
(),
ProcessExecuteFlags
,
&
val
,
sizeof
val
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"got status %08x
\n
"
,
status
);
memcpy
(
code_mem
,
ret
,
sizeof
(
ret
));
handler
=
pRtlAddVectoredExceptionHandler
(
TRUE
,
&
dpe_handler
);
...
...
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