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
b91a6298
Commit
b91a6298
authored
Jul 25, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid accessing the TEB after the memory view has been released.
When using reserved areas the memory could potentially be reused right after the release.
parent
7b767fb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
server.c
dlls/ntdll/server.c
+10
-4
No files found.
dlls/ntdll/server.c
View file @
b91a6298
...
...
@@ -141,6 +141,7 @@ void server_exit_thread( int status )
{
struct
wine_pthread_thread_info
info
;
SIZE_T
size
;
int
fds
[
4
];
RtlAcquirePebLock
();
RemoveEntryList
(
&
NtCurrentTeb
()
->
TlsLinks
);
...
...
@@ -151,6 +152,11 @@ void server_exit_thread( int status )
info
.
teb_sel
=
wine_get_fs
();
info
.
exit_status
=
status
;
fds
[
0
]
=
ntdll_get_thread_data
()
->
wait_fd
[
0
];
fds
[
1
]
=
ntdll_get_thread_data
()
->
wait_fd
[
1
];
fds
[
2
]
=
ntdll_get_thread_data
()
->
reply_fd
;
fds
[
3
]
=
ntdll_get_thread_data
()
->
request_fd
;
size
=
0
;
NtFreeVirtualMemory
(
GetCurrentProcess
(),
&
info
.
stack_base
,
&
size
,
MEM_RELEASE
|
MEM_SYSTEM
);
info
.
stack_size
=
size
;
...
...
@@ -160,10 +166,10 @@ void server_exit_thread( int status )
info
.
teb_size
=
size
;
pthread_functions
.
sigprocmask
(
SIG_BLOCK
,
&
block_set
,
NULL
);
close
(
ntdll_get_thread_data
()
->
wait_fd
[
0
]
);
close
(
ntdll_get_thread_data
()
->
wait_fd
[
1
]
);
close
(
ntdll_get_thread_data
()
->
reply_fd
);
close
(
ntdll_get_thread_data
()
->
request_fd
);
close
(
fds
[
0
]
);
close
(
fds
[
1
]
);
close
(
fds
[
2
]
);
close
(
fds
[
3
]
);
pthread_functions
.
exit_thread
(
&
info
);
}
...
...
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