fix(libkernel): return EOVERFLOW for lseek offset overflow #5274

Closed
MarcZX10 wants to merge 4 commits from upstream-pr/5274 into main
MarcZX10 commented 2026-10-13 16:14:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T16:14:00Z.


What

Carries Hussein Kadhim's lseek overflow fix and its follow-up commits with their original authorship preserved. Positive SEEK_CUR or SEEK_END offsets whose sum overflows a signed 64-bit position now return guest EOVERFLOW (84), while non-overflow failures keep their existing errors. Adds regression coverage for both lseek and sceKernelLseek, including failed-seek position preservation.

Tested

  • Linux, GCC 12.2: built guest_lseek_overflow_tests, guest_file_vector_tests, and guest_kernel_fcntl_tests.
  • CTest guest_lseek_overflow, guest_file_vector, and guest_kernel_fcntl: 3/3 passed.
  • Regression confirmed: with current main's Open.cpp, guest_lseek_overflow aborts at the first overflowing relative seek with errno 22; this branch passes.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main passed.
  • No Windows run in this environment.

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; silent stubs are listed under technical debt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4846128535 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5274). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T16:14:00Z. --- ### What Carries Hussein Kadhim's `lseek` overflow fix and its follow-up commits with their original authorship preserved. Positive `SEEK_CUR` or `SEEK_END` offsets whose sum overflows a signed 64-bit position now return guest `EOVERFLOW` (84), while non-overflow failures keep their existing errors. Adds regression coverage for both `lseek` and `sceKernelLseek`, including failed-seek position preservation. ### Tested - Linux, GCC 12.2: built `guest_lseek_overflow_tests`, `guest_file_vector_tests`, and `guest_kernel_fcntl_tests`. - CTest `guest_lseek_overflow`, `guest_file_vector`, and `guest_kernel_fcntl`: 3/3 passed. - Regression confirmed: with current `main`'s `Open.cpp`, `guest_lseek_overflow` aborts at the first overflowing relative seek with errno 22; this branch passes. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main` passed. - No Windows run in this environment. ### Checklist - [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 - [x] Unimplemented paths throw; silent stubs are listed under technical debt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
oneandonlydean commented 2026-10-14 02:30:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:30:16Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159556481 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5274#issuecomment-6159556481). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:30:16Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Pull request closed

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!5274
No description provided.