test(libkernel): cover invalid flags parameter in ktimer settime #14496

Merged
slopgobblercobbler merged 1 commit from upstream-pr/14496 into main 2026-11-20 04:33:32 +00:00
slopgobblercobbler commented 2026-11-01 15:15:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by slopgobblercobbler on 2026-11-01T15:15:58Z.


What

Add test coverage in GuestKernelSysKtimer.cpp verifying ktimer_settime copyin error precedence with null value pointer returning EFAULT across relative and absolute flags in accordance with docs/dev/debt/libkernel.md.

Tested

Ran python tools/check_conventions.py --base upstream/main --head HEAD successfully with 0 findings.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5108673499 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14496). Originally posted by [slopgobblercobbler](https://github.com/slopgobblercobbler) on 2026-11-01T15:15:58Z. --- ### What Add test coverage in `GuestKernelSysKtimer.cpp` verifying `ktimer_settime` copyin error precedence with null value pointer returning `EFAULT` across relative and absolute flags in accordance with docs/dev/debt/libkernel.md. ### Tested Ran `python tools/check_conventions.py --base upstream/main --head HEAD` successfully with 0 findings. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-02 04:44:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:44:54Z.

Review: COMMENTED


Reviewed — no blocking findings

The test expects EINVAL for invalid flags, and the production change adds that check to ktimer_settime (libkernel/Time/Ktimer.cpp), where the base accepted any flags. The added line is the same check as in #14695, which I reviewed earlier, so the two PRs change the same line.

What I ran

  • Head 8aa9884d2d20927be624c9d8a83c4c5c84fca91e; base f2d874c1fdccf781c0fa5d86619bb5dd8894b958. 2 files, +6/-0: Ktimer.cpp (one check) and GuestKernelSysKtimer.cpp.
  • Read the diff and the ktimer_settime function (Ktimer.cpp lines 119-124 at base, where the check is after the null-value check).

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed depends on none; the stack check passed
Invalid flags return EINVAL passed the added check is the same as in #14695
Hosted Windows CTest passed one tool case passed; the guest ktimer test was not in the run
Build and runtime tests not run no local build
Negative controls not run no local build
Hosted CI passed windows and report passed; linux and relinkers skipped
Read-only check output

Precheck was not run: this session does not run code from PR heads. The read-only checks (diff check, conventions, ABI audit, stack check) were run from the trusted main checkout; the Windows CTest result is from the hosted run.

Hosted Windows CTest for this head: conventions_ci_gate Passed

Hosted: gh api repos/boykopovar/AnyPS5/commits/8aa9884d2d20927be624c9d8a83c4c5c84fca91e/check-runs.

Negative control

Not run here. A negative control needs a build, and code from this head is not run here.

Findings

Blocking

None.

Non-blocking

  • The title is "test(libkernel): cover invalid flags parameter in ktimer settime", but the diff changes behaviour (the check is new in this PR). Please retitle it as a fix and state that. The same check is in #14695; the two PRs touch the same line, so one should land first and the other be rebased.

Sources

Not verified

  • The Linux behaviour was not checked.

To get this to a good state

  • Nothing blocking.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732173381 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14496#pullrequestreview-5732173381). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:44:54Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The test expects EINVAL for invalid flags, and the production change adds that check to `ktimer_settime` (`libkernel/Time/Ktimer.cpp`), where the base accepted any flags. The added line is the same check as in #14695, which I reviewed earlier, so the two PRs change the same line. ## What I ran - Head `8aa9884d2d20927be624c9d8a83c4c5c84fca91e`; base `f2d874c1fdccf781c0fa5d86619bb5dd8894b958`. 2 files, +6/-0: `Ktimer.cpp` (one check) and `GuestKernelSysKtimer.cpp`. - Read the diff and the `ktimer_settime` function (`Ktimer.cpp` lines 119-124 at base, where the check is after the null-value check). ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | conventions check from the main checkout | | Mergeability and dependencies | passed | depends on none; the stack check passed | | Invalid flags return EINVAL | passed | the added check is the same as in #14695 | | Hosted Windows CTest | passed | one tool case passed; the guest ktimer test was not in the run | | Build and runtime tests | not run | no local build | | Negative controls | not run | no local build | | Hosted CI | passed | windows and report passed; linux and relinkers skipped | <details><summary>Read-only check output</summary> Precheck was not run: this session does not run code from PR heads. The read-only checks (diff check, conventions, ABI audit, stack check) were run from the trusted main checkout; the Windows CTest result is from the hosted run. Hosted Windows CTest for this head: conventions_ci_gate Passed Hosted: `gh api repos/boykopovar/AnyPS5/commits/8aa9884d2d20927be624c9d8a83c4c5c84fca91e/check-runs`. </details> ## Negative control Not run here. A negative control needs a build, and code from this head is not run here. ## Findings **Blocking** None. **Non-blocking** - The title is "test(libkernel): cover invalid flags parameter in ktimer settime", but the diff changes behaviour (the check is new in this PR). Please retitle it as a fix and state that. The same check is in #14695; the two PRs touch the same line, so one should land first and the other be rebased. ## Sources - Changed file: https://github.com/boykopovar/AnyPS5/blob/8aa9884d2d20927be624c9d8a83c4c5c84fca91e/core/libs/tests/GuestKernelSysKtimer.cpp ## Not verified - The Linux behaviour was not checked. ## To get this to a good state - Nothing blocking.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14496
No description provided.