kernel: stop sign-extending batch-map protection and type #405
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!405
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/405/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?
@brandostrong on GitHub · 2026-08-29 19:04 UTC · original
brandostrong:fix/batch-map-protection-sign→main· +9 −9 · 2 files · 1 commits · merged 2026-08-29 21:46 UTCProblem
KernelBatchMapEntry::protectionand::typearechar, signed on the build platforms, and every use passes them to anint. A protection of0xf3widens to0xfffffff3.Harmless for mapping, where only bits 0-5 are tested, but
KernelQueryMemoryProtectionreturns the stored value straight to the guest — so a guest that maps with0xf3reads back0xfffffff3. TheLOGFinKernelBatchMap2already casts both fields throughunsigned char.Change
char->unsigned char.sizeofis unchanged and the existingstatic_assertstill holds; the now-redundant cast inLOGFis removed.Found while chasing an unrelated crash, with no game symptom to attribute to it.
AI assistance
Let me know if this is slop, claude caught and noted this whilst looking into an unrelated problem.
@Nmzik on GitHub · 2026-08-29 21:46 UTC · original
It is valid bug actually!