[2/2] ntdll: Allow reading from a VPROT_WRITECOPY protected memory

Dmitry Timoshkov dmitry at baikal.ru
Tue Sep 6 04:24:46 CDT 2011


Francois Gouget  wrote:

> The kernel32:loader test was crashing on line 660:
> 
>     ok(!memcmp((const char *)info.BaseAddress, section_data, 
>        section.SizeOfRawData), "wrong section data\n");
> 
> Further that was just for the following entries:
>         { IMAGE_SCN_MEM_WRITE, PAGE_WRITECOPY },
> and
>         { IMAGE_SCN_MEM_WRITE | IMAGE_SCN_MEM_EXECUTE, PAGE_EXECUTE_WRITECOPY },
> 
> 
> > If yes, then the fix should be done in different place.
> 
> What do you suggest?

The relevant part of
http://source.winehq.org/git/wine.git/commitdiff/3d81e97c753a73646081b1084ad64c88b71f4cc8

is

- if (sec->Characteristics & IMAGE_SCN_MEM_WRITE) vprot |= VPROT_READ|VPROT_WRITE;
+ if (sec->Characteristics & IMAGE_SCN_MEM_WRITE) vprot |= VPROT_WRITECOPY;

So, probably restore adding VPROT_READ. I should note, that VPROT_READ
not always was there, I added it long time ago for a broken DLL which was
crashing on Linux. Perhaps Linux has been fixed since then.

-- 
Dmitry.




More information about the wine-devel mailing list