fix(libkernel): enforce POSIX semaphore count limits #428
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/428"
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 RomainROCH on 2026-10-03T02:27:45Z.
What
Enforce the guest POSIX semaphore maximum of
0x7fffffff. Reject larger initial values with guestEINVAL. Rejectsem_postat the maximum with guestEOVERFLOW(84), under the existing lock and before incrementing or notifying.Invalid initialization preserves the caller's storage. Rejected posts preserve the count, which remains readable through
sem_getvalue.Tested
Tested commit:
eae05782afa6be74497b14381670a607376684db, based onmainat7d40a57d185b30735fbc519a9bdf2548d4bcb87f.The full fork Build workflow succeeded on both platforms: Release configuration, default build,
libstarget, and CTest with--repeat until-fail:3.The focused
guest_posix_sem_initandguest_posix_sem_postregressions passed on both platforms in all three repetitions. The skipped tests are GPU execution tests: two on Linux and eleven on Windows.The initial Linux attempt failed only on
agc_driver_vopc_compare(thread 1, compare 39), while both semaphore regressions passed. Windows succeeded on that attempt. Only Linux was rerun, without changing the commit or workflow, and the second attempt succeeded. GPU and shader sources are unchanged by this PR; the base and the independent Unicode branch also passed their Linux workflows. The cause of the first GPU failure is unconfirmed.These are fork results on the specified commit. An upstream workflow requiring maintainer approval has not executed until approved.
Both regressions failed before the correction. Coverage includes initial values above the maximum, successful initialization at the maximum, unchanged output and count on failure, repeated overflow, decrement and increment at the boundary, and normal empty/nonempty semaphore operations.
This changes the POSIX semaphore implementation, independently of #315 (
sceKernelSignalSema). All fixtures are synthetic. No game or homebrew title was tested; these results do not establish game compatibility.Checklist
main; no other open PR implements the same functions