Repository navigation
[cDAC] Restore non-stub method resolution in GetRuntimeNameByAddress - #10
anurag6569201 wants to merge 1 commit into
Conversation
Source PR: dotnet#131977 Source head: 15a5415
⛔ Shipwright · BlockedRecommendation: do not merge PR #10 · Tier
Findings (4)
Fireworks usage: 7,513 input · 641 output · 8,154 total tokens · $0.0021 · 11s · 0 fix iteration(s) Open the Shipwright check for full evidence and the audit bundle. Use |
| // Try stub classification | ||
| CodeKind codeKind = eman.GetCodeKind(codeAddr); | ||
| if (codeKind == CodeKind.StubPrecode || codeKind == CodeKind.FixupPrecode) | ||
| TargetCodePointer managedCodeAddr = _target.Contracts.PrecodeStubs.GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr); |
There was a problem hiding this comment.
Shipwright · CRITICAL
The managed path unconditionally calls GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr) and passes the result to GetCodeBlockHandle without validating that the address i
Impact: The managed path unconditionally calls GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr) and passes the result to GetCodeBlockHandle without validating that the address is actually an interpreter precode. For non-precode addresses, the contract may return a null/default TargetCodePointer, and GetCodeBlockHandle on that invalid pointer can fail or return an unexpected handle. The previous code only invoked…
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
| // Try stub classification | ||
| CodeKind codeKind = eman.GetCodeKind(codeAddr); | ||
| if (codeKind == CodeKind.StubPrecode || codeKind == CodeKind.FixupPrecode) | ||
| TargetCodePointer managedCodeAddr = _target.Contracts.PrecodeStubs.GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr); |
There was a problem hiding this comment.
Shipwright · HIGH
The new managed-code path calls GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr) unconditionally and then passes the result to GetCodeBlockHandle.
Impact: The new managed-code path calls GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr) unconditionally and then passes the result to GetCodeBlockHandle. If the address is not an interpreter precode, the contract may return a null/default TargetCodePointer, and GetCodeBlockHandle on that invalid pointer can fail or return an unexpected handle. The previous code only called precode-specific APIs after confirming…
Suggested fix: Fix the review finding before release.
| // Try stub classification | ||
| CodeKind codeKind = eman.GetCodeKind(codeAddr); | ||
| if (codeKind == CodeKind.StubPrecode || codeKind == CodeKind.FixupPrecode) | ||
| TargetCodePointer managedCodeAddr = _target.Contracts.PrecodeStubs.GetInterpreterCodeFromInterpreterPrecodeIfPresent(codeAddr); |
There was a problem hiding this comment.
Shipwright · HIGH
The new code path trusts the result of GetInterpreterCodeFromInterpreterPrecodeIfPresent without checking whether the returned pointer is valid before dereferencing it via GetCodeB
Impact: The new code path trusts the result of GetInterpreterCodeFromInterpreterPrecodeIfPresent without checking whether the returned pointer is valid before dereferencing it via GetCodeBlockHandle. If the contract returns a null or attacker-influenced pointer for a non-precode address, this could lead to an invalid memory access or unexpected handle resolution in the diagnostic data reader.
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.
dotnet#127134 removed handling of non-stubs, however, there are still tools that need this functionality.
Source merge-base:
ecc21b8a08df017dbe4d92e81191a028213d418eSource head:
15a5415519fe8cdb1dd2653ecff46a927f6d5076