未验证 提交 834593b2 编写于 作者: G github-actions[bot] 提交者: GitHub

Limit special diagnostics size region to 4KiB. (#91953)

This fixes out-of-bounds access when trying to write the
diagnostics info on platforms where the PAGE_SIZE is larger
than the DumpWriter's 16KiB m_tempBuffer.
Co-authored-by: NTom Deseyn <tom.deseyn@gmail.com>
Co-authored-by: NCarlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
上级 8181f031
......@@ -195,7 +195,7 @@ CrashInfo::GatherCrashInfo(DumpType dumpType)
return false;
}
// Add the special (fake) memory region for the special diagnostics info
MemoryRegion special(PF_R, SpecialDiagInfoAddress, SpecialDiagInfoAddress + PAGE_SIZE);
MemoryRegion special(PF_R, SpecialDiagInfoAddress, SpecialDiagInfoAddress + SpecialDiagInfoSize);
m_memoryRegions.insert(special);
#ifdef __APPLE__
InitializeOtherMappings();
......
......@@ -24,6 +24,8 @@ const uint64_t SpecialDiagInfoAddress = 0x7fff1000;
#endif
#endif
const uint64_t SpecialDiagInfoSize = 0x1000;
struct SpecialDiagInfoHeader
{
char Signature[16];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册