fix(libkernel): validate clock_settime before EPERM #17551
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17551"
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?
Imported from boykopovar/AnyPS5. Originally posted by AasishDairelSahayaGrinspan on 2026-11-08T21:52:58Z.
What
Validate
clock_settimearguments like FreeBSD 11.4 before returningEPERMfor a validCLOCK_REALTIMErequest. This preserves the host clock and models the title's jailed environment rather than throwing for valid requests.Tested
macOS 26, AppleClang:
python3 tools/check_conventions.py --base origin/mainpassed. Build/test attempted viacmake -S . -B build-clock-settime -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ONandcmake --build build-clock-settime --target guest_freebsd_clocks_tests -j 4; build blocked by existing unrelated compile errors incore/libs/prx/libc/src/RunReport.cpp(std::threadunavailable in this compiler configuration). The new test adds valid realtime →EPERMand verifies invalid clock/field inputs →EINVAL; the existing validation cases remain. No PS5 hardware test.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-09T08:51:59Z.
Review: COMMENTED
Windows run of head
4b61ec368d, merged ontomain286b14d2f7in one tree with 47 other small open PRs that touch different files. Setup: Windows 11, WinLibs GCC 15.2 r7 (x86_64-ucrt-posix-seh, the CI toolchain), Release,BUILD_TESTING=ON.guest_freebsd_clockswith--repeat until-fail:5: 5 / 5 pass.main'sTime.cppand this PR's test: 5 / 5 runs fail.Pull request closed