fix(libkernel): return EOVERFLOW from lseek on 64-bit offset overflow #5325
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5325"
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 Kikoarl on 2026-10-13T17:17:44Z.
What
FreeBSD 11.4
vn_seekreturnsEOVERFLOWwhen a relative seek withSEEK_CURorSEEK_ENDoverflows a 64-bit signed offset (INT64_MAX), keepingEINVALfor seeks that land before the start of the file.When
NativeLseekfails withEINVALon a positive relative offset, compute base plus offset and returnEOVERFLOW(0x80020054forsceKernelLseek,errno = 84forlseek) if the computation overflows, otherwise preservingerrno.Closes #5248
Tested
/tmp/anyps5_build).ctest -R guest_lseek_overflow: verifiesSEEK_CURandSEEK_ENDoverflow cases returningEOVERFLOW, negative seeks returningEINVAL, and seeks nearINT64_MAX.ctest -R "guest_kernel_fcntl|guest_file_vector".python3 tools/check_conventions.py.Checklist
python3 tools/check_conventions.pydocs/dev/TechnicalDebt.md(if applicable)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T17:24:04Z.
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.
main)core/libs/prx/libkernel/CMakeLists.txtL1212core/libs/prx/libkernel/CMakeLists.txtL1212core/libs/tests/GuestLseekOverflow.cppImported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-13T17:38:28Z.
Closing in favor of earlier carry in #5274.
Pull request closed