Repository navigation
fix(libkernel): limit UTC-to-local DST output to 32 bits - #3855
Conversation
|
Retested on Linux (Ubuntu 24.04, GCC 13) and Windows 11 (MinGW-w64 GCC 15.2 from WinLibs), Release, as asked on #3606.
Linux can't take PShare that far here, since the headless run stops in |
|
Thanks @babyhuey for the cross-platform retest and for confirming the canary catches the overwrite! I followed up on PShare’s graphics stop and tested AlxcBTW’s existing fix: AlxcBTW/AnyPS5#12, commit On Windows 11 with a GTX 1660 SUPER, using It still aborts later on I posted the A/B results in #3581. AlxcBTW confirmed they’re adding PShare to the affected-title list and will open the fix upstream once #3546 is merged. |
What
Fix the PShare 1.0 (PPSA99773) Windows null read reported by babyhuey in #3606 (comment).
sceKernelConvertUtcToLocaltimewrites eight bytes through its DST output, while PShare passes a four-byteint. The extra four bytes overwrite the savedrbxinpshare::local_time, zeroing the model pointer later used byApp::draw_top_bar.Change that output to
int32_t*and extendguest_freebsd_clockswith a canary immediately after the four-byte result. The existing UTC conversion and optional output behavior stay the same.ABI evidence: the PShare 1.0 call site allocates an
intfor this result, and fpPS4 declares and writes it throughPDWORD. The reverse conversion in AnyPS5 already usesint32_t*. This has not been measured on a physical PS5; shadPS4 currently usesu64*, so the differing public declarations are explicit for review.Tested
Windows 11, MinGW-w64 GCC 15.2.0, Release, Ryzen 5 3600 / GTX 1660 SUPER. Base:
maina11c8f7f.guest_freebsd_clocksfails with this test against unchanged main (SIGABRT, adjacent canary overwritten), then passes with the one-line implementation change.guest_time_conversion,guest_process_time,guest_process_time_counter, their two scaled variants,guest_cpu_time_clocks, andguest_thread_cpu_clock.git diff --checkpass. The repository overlap checker found no overlap with 355 open PRs. No Linux runtime test or physical-console ABI test was run.PShare runtime validation also applies #3606 (
187fd853) to resolvegetlogin_r; that commit is not included in this PR. On main alone, the existing stop isFAIL: unresolved ELF import 78FiHequa9U (getlogin_r) from libkernel.prx.The public PShare 1.0 release was relinked with
--windows --registry, with its bundledlibc.prxand assets. Release ZIP SHA-256:a9a07cdeac7b6ab6d6ce5faebb1e128d232ce9c173b976170a77abecdb8be807.Before (
main+ #3606), all 20 sounds load, thenapp.exe+0x12f1breads0x240. A GDB hardware watchpoint catches the exact overwrite:After (this fix + #3606), the same instruction has
rax=0x60d100, matching the model pointer, and PShare reaches GPU submission. The next stop on this GPU is:This fixes the reported null read; it does not claim working presentation or a fully usable PShare.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository