feat(libSceNKWebKit): implement constant-time memory comparison #13770
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13770"
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 hyvvs on 2026-10-31T05:12:15Z.
What
Implement previously throwing
WTF::constantTimeMemcmp(const void*, const void*, size_t)inlibSceNKWebKit, preserving the Itanium symbol, System V guest calling convention, and full 0/nonzero byte-comparison behavior. Based on Sony PS5 WebKit 11.x's CryptographicUtilities.cpp. Accumulates XOR differences across the entire input range; does not stop at the first mismatch. The published source'sNEVER_INLINEis retained as[[gnu::noinline]]. Nonempty invalid null pointers throw rather than dereferencing invalid memory.The export is removed from the throwing inventory and implemented in a separate
WtfCryptoUtilities.cppwith its typed public declaration. A focused CTest target and debt note document source and limits. No new dependencies or third-party binaries.Tested
-O2 -Wall -Wextra -Werror -fsanitize=address,undefined, execution withASAN_OPTIONS=detect_leaks=1(empty, identical, prefix, different high bytes, multiple different bytes, unaligned).-O0 -Wall -Wextra -Werror, linked and executed guest SysV ABI standalone test.python tools/tests/test_progress.py(56 tests), public header audit (393 libraries / 24536 exports),python tools/check_conventions.py --base upstream/mainandgit diff --check.18f5949788: 7229/27404 -> 7230/27404 (+1 genuine implemented export; inventory unchanged).HAVE(TIMINGSAFE_BCMP)conditional, whose console setting has not been observed; timing constancy is not established solely by functional tests.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-31T06:23:46Z.
Review: COMMENTED
Linux run of head
4d9e58c8d2, merged (--no-commit) ontomain6a691f69ee. Ubuntu 26.04 (kernel 7.0), GCC 15.2.0, CMake 4.2.3, Ninja, Release,BUILD_TESTING=ON, i7-8700. The description lists the full CMake/CTest run as not done, so this is that run.guest_nkwebkit_constant_time: passes 3/3.nkwebkit: 3/3.public_headers: 65/65._ZN3WTF18constantTimeMemcmpEPKvS1_m(a stand-in for themainstub) makesguest_nkwebkit_constant_timeabort 3/3.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Pull request closed