Repository navigation
fix(libkernel): return EFAULT from cpuset and pthread affinity for invalid memory - #13908
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The exact head 64ff517803b7017e2116c7348f46713d4c8bb9e7 safely copies affinity masks through the guest-memory helpers and reports EFAULT for invalid pointers.
I reviewed it against base 60bdb061356db736928eee431cd8bd4c9ba68036. The no-build precheck passed diff, conventions, and mergeability; its ABI/test-quality helper scripts were unavailable in the isolated PR checkout. The separate ABI audit passed with no findings. The author reports repeated focused Linux tests and a negative control; hosted Windows was still running and Linux was skipped in CI. I did not run a local C++ build or test binary.
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 13908
python3 tools/pr_abi_audit.py --base 60bdb061356db736928eee431cd8bd4c9ba68036 --head 64ff517803b7017e2116c7348f46713d4c8bb9e7 --json|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
@DeveshB-1 Reviewed at |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
64ff517 to
16135b4
Compare
|
Checked the four functions: copy-in happens before any state change, copy-out after the lookups, buffers cover every accepted size, and the new test ( |
What
Safely copy in and copy out CPU affinity masks using
GuestCopyIn_nid_no_patchandGuestCopyOut_nid_no_patchincpuset_getaffinity,cpuset_setaffinity,pthread_getaffinity_np, andpthread_setaffinity_np, returningEFAULTwhen the caller provides invalid or unmapped memory pointers.Tested
Linux (Ubuntu 24.04, x86_64). Added negative control assertions passing unmapped pointer stores (
0x10) toGuestAvailableCpumask.cpp. Verified that the unpatched base crashed withSIGSEGVand that the change cleanly returnsEFAULT/ setserrnotoEFAULT(14). Verifiedguest_available_cpumaskpasses cleanly across repeated test runs. Ranpython3 tools/check_conventions.py --base origin/mainandpython3 tools/pr_overlap.py --branch fix/cpuset-affinity-efault(no overlap).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)