未验证 提交 1dc5eba5 编写于 作者: J Jan Vorlicek 提交者: GitHub

Fix interleaved heap RW commit failure handling (#73566)

We were not checking the result of the ExecutableAllocator::Commit call
for mapping the RW page in the case of interleaved heaps. I've seen a
failure in the CI that seems to be caused by this - when we succeeded
committing the RX page, but failed to commit the related RW page, we
have then crashed when trying to initialize the precode stubs data.

This change adds the check to fix the problem. This causes the
LoaderHeap allocation to fail as expected in such case.
上级 9687016b
......@@ -1304,14 +1304,17 @@ BOOL UnlockedLoaderHeap::GetMoreCommittedPages(size_t dwMinSize)
void *pData = ExecutableAllocator::Instance()->Commit(m_pPtrToEndOfCommittedRegion, dwSizeToCommitPart, IsExecutable());
if (pData == NULL)
{
_ASSERTE(!"Unable to commit a loaderheap page");
return FALSE;
}
if (IsInterleaved())
{
// Commit a data page after the code page
ExecutableAllocator::Instance()->Commit(m_pPtrToEndOfCommittedRegion + dwSizeToCommitPart, dwSizeToCommitPart, FALSE);
void* pDataRW = ExecutableAllocator::Instance()->Commit(m_pPtrToEndOfCommittedRegion + dwSizeToCommitPart, dwSizeToCommitPart, FALSE);
if (pDataRW == NULL)
{
return FALSE;
}
ExecutableWriterHolder<BYTE> codePageWriterHolder((BYTE*)pData, GetOsPageSize());
m_codePageGenerator(codePageWriterHolder.GetRW(), (BYTE*)pData);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册