[PATCH v2] ntdll: Fix find_free_area outside of reserved areas with zero_bits != 0.

Huw Davies huw at codeweavers.com
Wed Nov 20 04:57:05 CST 2019

On Mon, Nov 04, 2019 at 04:51:56PM +0100, Rémi Bernon wrote:
> The search was initiated with base == 0, which returns NULL immediately
> if MEM_TOP_DOWN is not used. Using address_space_start instead fixes
> this issue.
> Then we assumed that all mmapped regions are known by Wine view tree,
> which is obviously not the case with external allocations. This could
> lead to memory corruption when find_free_area returns an expected free
> region which is already mmapped. Using MAP_FIXED forces mmap to succeed
> and corrupts the mapping.

So it seems this patch is trying to fix two bugs.  You should be able
to split this so that a first patch addresses the !top_down issue
and a second patch addresses the assumption about mmapped regions
being known.


More information about the wine-devel mailing list