fix(libkernel): reject invalid flags in ktimer_settime #12281
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12281"
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 fogydes on 2026-10-28T07:06:00Z.
What
Reject unrecognized flags in
ktimer_settimewithEINVAL(FreeBSDsys/kern/kern_time.c:if ((flags & ~TIMER_ABSTIME) != 0) return (EINVAL);), matching the documented behavior indocs/dev/debt/libkernel.md:186. Previously,ktimer_settime_nid_postfixaccepted arbitrary flag bits without validation. Added unit test cases for invalid flag values inguest_kernel_sys_ktimer.Tested
Windows 11,
ctest --test-dir build -R guest_kernel_sys_ktimer -Vpassed. Red control verified on unpatchedKtimer.cppfailing atcore/libs/tests/GuestKernelSysKtimer.cpp:107.python tools/check_conventions.py --base origin/mainpassed.python tools/pr_overlap.py --branch fix/ktimer-settime-invalid-flagsreported 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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T08:53:08Z.
Review: APPROVED
The check rejects every bit outside
TIMER_ABSTIMEafter the existing null-value fault check and before timer lookup/update, so invalid requests do not mutate timer state. The test covers negative flags and several unsupported bits with EINVAL; Windows CI and conventions pass, and the author reports ten Linux/WSL runs against a clean main control. The check matches the project’s FreeBSD-based behavior for unsupported flags. No blocking issue found.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T09:28:24Z.
Review: APPROVED
Rechecked the new head
bdf916d924d8. The additional invalid-flag cases are appropriate and retain the earlier state-preservation/validation-order behavior. Hosted Windows, conventions, and report checks pass; the exact-head Linux control run was also reported. No blocker found.