<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="Osso Notes">
<title></title></head>
<body>
<p>I looked further into the problem I set out to fix, and realize that this patch is pretty terrible. The real bug is 22006 <a href="http://bugs.winehq.org/show_bug.cgi?id=22006">http://bugs.winehq.org/show_bug.cgi?id=22006</a> and affects the game Continuum <a href="http://appdb.winehq.org/appview.php?iVersionId=3703">http://appdb.winehq.org/appview.php?iVersionId=3703</a> basically, OpenProcess doesn't enfore ACLs
<br>
<br>I am a user of the game, and the instructions that other users have provided involve a patch which allow the game to function. I was applying the patch from the git source, and wanted to try my hand at submitting a patch. The patch provided is described in the appdb page, and I thought I would improve it.
<br>
<br>That patch (not the one I submitted) wouldn't leak any handles, since it returns null before attempting NtOpenProcess when (access & PROCESS_VM_WRITE). I'm not sure if that is proper behavior, but it still seems dangerous to me.
<br>
<br>Long story short, please disregard this patch, and while I will continue my efforts, any suggestions on how to approach bug 22006 would be greatly appreciated.
<br>
<br>Many thanks,
<br>Henry Blum
<br>
<br>----- Original message -----
<br>> 08.05.2010 9:10, Henry Blum wrote:
<br>> > ---
<br>> > dlls/kernel32/process.c | 2 +-
<br>> > 1 files changed, 1 insertions(+), 1 deletions(-)
<br>> >
<br>> > diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
<br>> > index 9a1f2f5..6dcad8f 100644
<br>> > --- a/dlls/kernel32/process.c
<br>> > +++ b/dlls/kernel32/process.c
<br>> > @@ -2657,7 +2657,7 @@ HANDLE WINAPI OpenProcess( DWORD access, BOOL
<br>> > inherit, DWORD id )
<br>> > if (GetVersion() & 0x80000000) access = PROCESS_ALL_ACCESS;
<br>> > status = NtOpenProcess(&handle, access, &attr, &cid);
<br>> > - if (status != STATUS_SUCCESS)
<br>> > + if (status != STATUS_SUCCESS || (access & PROCESS_VM_WRITE))
<br>> > {
<br>> > SetLastError( RtlNtStatusToDosError(status) );
<br>> > return NULL;
<br>>
<br>> Wouldn't this pretend operation failed for every request with
<br>> PROCESS_VM_WRITE, even if NtOpenProcess succeeded, and leak a handle?
<br>> Which bug should it fix?
<br><br></p>
</body>
</html>