loader/libs: validate guest-controlled ELF, AJM and socket-option inputs #1329
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!1329
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1329/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?
@HamsterCL on GitHub · 2026-10-09 20:44 UTC · original
HamsterCL:fix/loader-libs-input-validation→main· +89 −8 · 6 files · 2 commits · closed without mergingSplit out of #1313 (closed).
p_filesz > p_memsz.SO_RCVTIMEO/SO_SNDTIMEObetween guest and host units and validate the option size.Built and ran all 53 ctest tests locally (Windows, clang-cl).
@HamsterCL on GitHub · 2026-10-09 20:45 UTC · original
@coderabbitai review
@coderabbitai[bot] on GitHub · 2026-10-09 20:47 UTC · original · edited 2026-10-09 21:10 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
6a0ed77b-ccbe-4a6f-a380-fde6bcee6e4a📥 Commits
Reviewing files that changed from the base of the PR and between
153b3d892eandb6b4b62710.📒 Files selected for processing (3)
src/loader/elf.cppsrc/loader/elf.hsrc/loader/runtimeLinker.cpp🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
📝 Walkthrough
Walkthrough
The changes add overflow checks to split-buffer decoding and bounds checks to ELF loading, mapped address ranges, segments, and symbol tables.
Elf64now stores and exposes the loaded dynamic-data size. Socket-option handling adds receive-timeout mapping and conversion between guest milliseconds and host units. Unsupported socket-level options now return an error.Suggested reviewers:
nmzikPriority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
b6b4bNo confirmed regression warrants blocking merge. The target-specific socket timeout layout could not be verified, so no ABI mismatch is established.
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.@coderabbitai[bot] on GitHub · 2026-10-09 20:47 UTC · original · reviewed
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
4ee9aa5e-9842-43e5-80b5-06b8aa4359ad📥 Commits
Reviewing files that changed from the base of the PR and between
59183dbfa8and153b3d892e.📒 Files selected for processing (5)
src/libs/ajm.cppsrc/libs/network.cppsrc/loader/elf.cppsrc/loader/gamePatch.cppsrc/loader/runtimeLinker.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
@coderabbitai[bot] on GitHub · 2026-10-09 20:47 UTC · original · edited 2026-10-09 20:57 UTC
On
src/loader/runtimeLinker.cppline 1919 (outdated):🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Validate
DT_OS_SYMTABagainst its own buffer.When an ELF uses
DT_OS_SYMTAB,GetDynDataOsobtains the symbol table fromElf64::GetDynamicData.Elf64::Openloads that data into the separatem_dynamic_dataallocation. This check instead requires the pointer to be at or aboveprogram->base_vaddr, so a valid OS symbol table causesParseProgramDynamicInfoto terminate. Validate OS symbol tables against the dynamic-data allocation. Keep the program-mapping check forDT_SYMTAB.✅ Addressed in commit
b6b4b62@coderabbitai[bot] on GitHub · 2026-10-09 20:49 UTC · original
⚠️ Action not completed
Already reviewed the last commit. Use
@coderabbitai full reviewto rerun a review of the entire changeset.@HamsterCL on GitHub · 2026-10-09 20:58 UTC · original
@coderabbitai review
@coderabbitai[bot] on GitHub · 2026-10-09 21:10 UTC · original
⚠️ Action not completed
Already reviewed the last commit. Use
@coderabbitai full reviewto rerun a review of the entire changeset.Pull request closed