Skip to content

Commit 834593b

Browse files
github-actions[bot]tmdscarlossanlop
authored
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: Tom Deseyn <tom.deseyn@gmail.com> Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com>
1 parent 8181f03 commit 834593b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/coreclr/debug/createdump/crashinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ CrashInfo::GatherCrashInfo(DumpType dumpType)
195195
return false;
196196
}
197197
// Add the special (fake) memory region for the special diagnostics info
198-
MemoryRegion special(PF_R, SpecialDiagInfoAddress, SpecialDiagInfoAddress + PAGE_SIZE);
198+
MemoryRegion special(PF_R, SpecialDiagInfoAddress, SpecialDiagInfoAddress + SpecialDiagInfoSize);
199199
m_memoryRegions.insert(special);
200200
#ifdef __APPLE__
201201
InitializeOtherMappings();

src/coreclr/debug/createdump/specialdiaginfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const uint64_t SpecialDiagInfoAddress = 0x7fff1000;
2424
#endif
2525
#endif
2626

27+
const uint64_t SpecialDiagInfoSize = 0x1000;
28+
2729
struct SpecialDiagInfoHeader
2830
{
2931
char Signature[16];

0 commit comments

Comments
 (0)