Fix fault counter overflow in FaultManager #869
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!869
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/869/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Hamadshu on GitHub · 2026-09-27 17:54 UTC · original
Hamadshu:fix-fault-manager-overflow→main· +13 −1 · 1 files · 1 commits · closed without mergingSummary
Fixes a buffer over-read in
FaultManager::ProcessFaultBuffer.The compute shader
fault_buffer_process.compstops writing fault entriesonce
store_index >= MAX_PAGE_FAULTS, but it keeps incrementing the counterin
download_buffer[0]. The host then readsfaults[0]entries contiguouslystarting at
faults[1], which walks past the end of the current fault areaand into the next area's bytes.
Root cause
fault_buffer_process.comp:faultManager.cpp:Fix
Clamp the counter on the host side before reading. The shader is intentionally
left as-is because changing it would require reworking the counter to be
atomic-safe across workgroups, and the host fix is a one-line change that
covers every driver and every shader revision.
Changes
faultManager.cpp: clampfaults[0]toMaxPageFaults - 1and logoverflow at yellow level.
Testing
Built the emulator locally with this change. No counter overflow is
observed in normal runs; the clamp only fires when the shader's counter
genuinely exceeds capacity.
@coderabbitai[bot] on GitHub · 2026-09-27 17:59 UTC · original
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
10fc8280-5f25-4112-9abb-c58f16636719📥 Commits
Reviewing files that changed from the base of the PR and between
421684e75fand43345a76b4.📒 Files selected for processing (1)
src/graphics/host_gpu/renderer/cache/faultManager.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
📝 Walkthrough
Walkthrough
FaultManager::ProcessFaultBuffernow caps the number of fault entries it processes atMaxPageFaults - 1. When the raw counter exceeds this limit, it logs both the raw and clamped counts.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
43345The clamp preserves every valid fault entry while preventing reads beyond the buffer. No concrete merge-blocking risk is established.
Security Architecture Review
Security architecture risk: 🔵 Low · up to
43345The host now limits fault-entry reads to the allocated area without adding a new entrypoint or expanding access. The remaining risk is low, though external reachability and broader security coverage are not established.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.Pull request closed