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
94872cc8
Commit
94872cc8
authored
Sep 12, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix access rights checks for mapping objects.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
fcd7d440
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
16 deletions
+13
-16
virtual.c
dlls/kernel32/tests/virtual.c
+5
-11
loader.c
dlls/ntdll/loader.c
+2
-1
virtual.c
dlls/ntdll/virtual.c
+6
-4
No files found.
dlls/kernel32/tests/virtual.c
View file @
94872cc8
...
...
@@ -3710,16 +3710,16 @@ static DWORD map_prot_to_access(DWORD prot)
switch
(
prot
)
{
case
PAGE_READWRITE
:
return
SECTION_MAP_READ
|
SECTION_MAP_WRITE
|
SECTION_
MAP_EXECUTE
|
SECTION_
QUERY
;
return
SECTION_MAP_READ
|
SECTION_MAP_WRITE
|
SECTION_QUERY
;
case
PAGE_EXECUTE_READWRITE
:
return
SECTION_MAP_READ
|
SECTION_MAP_WRITE
|
SECTION_MAP_EXECUTE
|
SECTION_
MAP_EXECUTE_EXPLICIT
|
SECTION_
QUERY
;
return
SECTION_MAP_READ
|
SECTION_MAP_WRITE
|
SECTION_MAP_EXECUTE
|
SECTION_QUERY
;
case
PAGE_READONLY
:
case
PAGE_WRITECOPY
:
return
SECTION_MAP_READ
|
SECTION_
MAP_EXECUTE
|
SECTION_
QUERY
;
return
SECTION_MAP_READ
|
SECTION_QUERY
;
case
PAGE_EXECUTE
:
case
PAGE_EXECUTE_READ
:
case
PAGE_EXECUTE_WRITECOPY
:
return
SECTION_MAP_READ
|
SECTION_MAP_EXECUTE
|
SECTION_
MAP_EXECUTE_EXPLICIT
|
SECTION_
QUERY
;
return
SECTION_MAP_READ
|
SECTION_MAP_EXECUTE
|
SECTION_QUERY
;
default:
return
0
;
}
...
...
@@ -3909,17 +3909,11 @@ static void test_mapping( HANDLE hfile, DWORD sec_flags )
/* FILE_MAP_EXECUTE | FILE_MAP_COPY broken on XP */
if
(
base
!=
NULL
&&
view
[
j
].
access
==
(
FILE_MAP_EXECUTE
|
FILE_MAP_COPY
))
{
todo_wine
ok
(
broken
(
base
!=
NULL
),
"%d: MapViewOfFile(%04x/%04x) should fail
\n
"
,
j
,
page_prot
[
i
],
view
[
j
].
access
);
UnmapViewOfFile
(
base
);
}
else
todo_wine_if
((
page_prot
[
i
]
==
PAGE_READONLY
&&
is_compatible_access
(
PAGE_EXECUTE_READ
,
view
[
j
].
access
))
||
(
page_prot
[
i
]
==
PAGE_READWRITE
&&
is_compatible_access
(
PAGE_EXECUTE_READWRITE
,
view
[
j
].
access
))
||
(
page_prot
[
i
]
==
PAGE_WRITECOPY
&&
is_compatible_access
(
PAGE_EXECUTE_WRITECOPY
,
view
[
j
].
access
)))
else
{
ok
(
!
base
,
"%d: MapViewOfFile(%04x/%04x) should fail
\n
"
,
j
,
page_prot
[
i
],
view
[
j
].
access
);
...
...
dlls/ntdll/loader.c
View file @
94872cc8
...
...
@@ -1842,7 +1842,8 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, LPCWSTR name, HANDLE file,
TRACE
(
"Trying native dll %s
\n
"
,
debugstr_w
(
name
));
size
.
QuadPart
=
0
;
status
=
NtCreateSection
(
&
mapping
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_QUERY
|
SECTION_MAP_READ
,
status
=
NtCreateSection
(
&
mapping
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_QUERY
|
SECTION_MAP_READ
|
SECTION_MAP_EXECUTE
,
NULL
,
&
size
,
PAGE_EXECUTE_READ
,
SEC_IMAGE
,
file
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
...
...
dlls/ntdll/virtual.c
View file @
94872cc8
...
...
@@ -2750,18 +2750,20 @@ NTSTATUS WINAPI NtMapViewOfSection( HANDLE handle, HANDLE process, PVOID *addr_p
switch
(
protect
)
{
case
PAGE_NOACCESS
:
case
PAGE_READONLY
:
case
PAGE_WRITECOPY
:
access
=
SECTION_MAP_READ
;
break
;
case
PAGE_READWRITE
:
case
PAGE_EXECUTE_READWRITE
:
access
=
SECTION_MAP_WRITE
;
break
;
case
PAGE_READONLY
:
case
PAGE_WRITECOPY
:
case
PAGE_EXECUTE
:
case
PAGE_EXECUTE_READ
:
case
PAGE_EXECUTE_WRITECOPY
:
access
=
SECTION_MAP_READ
;
access
=
SECTION_MAP_READ
|
SECTION_MAP_EXECUTE
;
break
;
case
PAGE_EXECUTE_READWRITE
:
access
=
SECTION_MAP_WRITE
|
SECTION_MAP_EXECUTE
;
break
;
default:
return
STATUS_INVALID_PAGE_PROTECTION
;
...
...
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