зеркало из https://github.com/mozilla/gecko-dev.git
e61c0c2555
The latest launcher process ping showed one of the reasons why we failed to detour `NtMapViewOfSection` is that `MMPolicyBase::FindRegion` failed to find a free region. Inspecting the function carefully, there were three problems. Firstly, `FindRegion` did not fully scan the given range. To randomize the address of a free region we use, we start scanning from a random address within the given range. The problem is we scan only addresses bigger than that random address, without scanning smaller addresses. Probably this is the reason why `FindRegion` fails. Secondly, `FindRegion` may return an address not aligned with the allocation granularity because `VirtualQueryEx` returns such an address. If that happens, the subsequent mapping API fails with the alignment error. Lastly, when we randomize an address to start scanning from, we divide a random number by `maxOffset`, but with that, we never start scanning from the last region. It does not affect the product's behavior, but to have fair randomization, a divisor should be `maxOffset + 1`. This patch fixes all of these three problems along with a new test program. Differential Revision: https://phabricator.services.mozilla.com/D94110 |
||
---|---|---|
.. | ||
android | ||
baseprofiler | ||
build | ||
dllservices | ||
linker | ||
misc | ||
static | ||
tests | ||
moz.build |