Skip to content

Commit b33cd4b

Browse files
committed
[KernelCache] Place synthetic sections after the cache's address range
This ensures they do not overlap with any images that may later be loaded from the kernel cache. Fixes #7634.
1 parent 1daa515 commit b33cd4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

view/kernelcache/core/KernelCacheView.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ Ref<Settings> KernelCacheViewType::GetLoadSettingsForData(BinaryView* data)
7474
"description" : "Add function starts sourced from the Function Starts tables to the core for analysis."
7575
})");
7676

77+
// Place the synthetic sections well after the kernel cache to ensure they do
78+
// not collide with any images that are later loaded from the kernel cache.
79+
constexpr uint64_t syntheticSectionsOffset = 256 * 1024 * 1024;
80+
settings->UpdateProperty("loader.syntheticSectionBase", "default", viewRef->GetStart() + syntheticSectionsOffset);
81+
7782
// Merge existing load settings if they exist. This allows for the selection of a specific object file from a Mach-O
7883
// Universal file. The 'Universal' BinaryViewType generates a schema with 'loader.universal.architectures'. This
7984
// schema contains an appropriate 'Mach-O' load schema for selecting a specific object file. The embedded schema

0 commit comments

Comments
 (0)