Fix uninitialized L3 cache value on CPUs without L3 cache - #621
Merged
Conversation
bugprogrammer
force-pushed
the
l3-cache-init
branch
from
August 29, 2026 12:28
6136231 to
5f51010
Compare
bugprogrammer
force-pushed
the
l3-cache-init
branch
from
August 29, 2026 12:35
5f51010 to
8c3d8aa
Compare
Contributor
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
When using the
ProvideCurrentCpuInfoquirk on CPUs without L3 cache (e.g. Intel Core 2 Quad Q9550), Mac OS X Tiger (10.4.x) correctly populates L2 cache information but reports a bogus 16 EB garbage value for L3 cache in About This Mac / System Profiler.This quirk is designed to inject real CPU cache information for older macOS versions. While L2 cache reporting works as intended, the L3 cache field was left uninitialized, leaking raw stack‑memory garbage values.
Root Cause
In
Library/OcAppleKernelLib/CpuidPatches.c, the Tiger‑specific cache injection logic triggered byProvideCurrentCpuInfodoes not zero‑initialize the L3 cache field when the target CPU lacks L3 cache. Uninitialized stack data gets injected into the kernel‑visible CPU cache structure.Fix
Explicitly zero‑initialize the L3 cache field before injecting cache metadata for Tiger under
ProvideCurrentCpuInfo.CPUs without L3 cache now omit the L3 entry entirely, preserving correct L2 cache reporting.
Testing
ProvideCurrentCpuInfo