Commit Graph
2648 Commits
Author SHA1 Message Date
Adrià c21eb9a4d0 Merge pull request #13742 from Gruzzberry/fix/socketpair-efault
fix(libkernel): fail socketpair with EFAULT on an unusable result pointer
2026-10-31 22:42:51 +01:00
Adrià 05ff2857e6 Merge pull request #13710 from dantdmdarealguy/agent/cifails4
test(libkernel): run guest_timed_wait_cpu alone on Windows
2026-10-31 22:38:42 +01:00
Adrià cac9da41e4 Merge pull request #13725 from cocoa55/fix/cond-relock-spin
fix(libkernel): spin and yield when a condition variable wait relocks its mutex
2026-10-31 22:20:43 +01:00
Adrià bdabbb8415 Merge pull request #13668 from notHaze/fix/libkernel-close-observer-init
fix(libkernel): initialize close observer registry on first use
2026-10-31 12:51:49 +01:00
Adrià e23eea90e2 Merge pull request #13660 from w4rc0n/fix/sched-own-pid-main-thread
fix(libkernel): select the registered main thread for own-pid scheduling
2026-10-31 12:45:48 +01:00
GruzzberryandClaude Sonnet 5.5 0d2ae1a300 fix(libkernel): release both socketpair descriptors when the copyout or registration throws
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 11:43:00 +00:00
GruzzberryandClaude Sonnet 5.5 6f42ff85b5 fix(libkernel): fail socketpair with EFAULT on an unusable result pointer
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 11:31:59 +00:00
akkadbakkad89andDevin 58295ef071 fix(libkernel): accept semaphore attribute bits 0x100 to 0x102
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-31 09:47:05 +01:00
Adrià 0835ec8bdc Merge pull request #13576 from pushkarreddyy/fix/direct-memory-queries-efault
fix(libkernel): return EFAULT from direct memory queries for invalid memory pointers
2026-10-31 05:15:50 +01:00
Adrià 696215b704 Merge pull request #13556 from pushkarreddyy/fix/flexible-memory-queries-efault
fix(libkernel): return EFAULT from flexible memory queries and PRT aperture for invalid memory
2026-10-31 05:14:45 +01:00
Adrià d4627bad7b Merge pull request #13552 from pushkarreddyy/fix/system-version-efault
fix(libkernel): return EFAULT from system version queries for invalid memory
2026-10-31 05:10:40 +01:00
Adrià 69c43dd403 Merge pull request #13577 from pushkarreddyy/fix/login-efault
fix(libkernel): return EFAULT from getlogin_r and SetLogin for invalid memory pointers
2026-10-31 05:08:35 +01:00
cocoa55andClaude Opus 5.5 8c4cdf84a2 test(libkernel): count the yields a woken condition variable wait makes
The mutex yield step counts each yield in a counter that
MutexYieldsForTest_nid_no_patch reads. With no spins and a yield count
of 5, a waiter woken while another thread holds its mutex must yield
exactly 5 times before it blocks, for each mutex type and for the outer
level of a recursive mutex held twice. With WakingLock::lock calling
the native lock directly the count stays 0 and the test aborts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 23:37:35 -04:00
cocoa55andClaude Opus 5.5 16375634e3 fix(libkernel): spin and yield when a condition variable wait relocks its mutex
FreeBSD 11.4's _mutex_cv_lock takes the mutex back through
mutex_lock_common, so a woken waiter tries once, spins and yields by
the mutex's counts before it blocks. The wait here called the native
lock directly; it now goes through the same spin and yield path as
scePthreadMutexLock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 22:47:35 -04:00
pushkarreddyy ba6940814e fix(libkernel): preserve errno across checked copies in sigwait 2026-10-31 08:16:23 +05:30
pushkarreddyy 9c5495b9e5 fix(libkernel): return EFAULT from sigtimedwait, sigwaitinfo and sigwait for invalid memory 2026-10-31 08:16:22 +05:30
pushkarreddyy 6c56fd9060 fix(libkernel): return EFAULT from flexible memory queries and PRT aperture for invalid memory 2026-10-31 08:15:41 +05:30
pushkarreddyy 9e915f9b62 fix(libkernel): return EFAULT from direct memory queries for invalid memory pointers 2026-10-31 08:14:53 +05:30
pushkarreddyy ce1c353f07 fix(libkernel): preserve errno and revert SetLogin in getlogin_r 2026-10-31 08:14:24 +05:30
pushkarreddyy b39c154ed2 fix(libkernel): return EFAULT from getlogin_r and SetLogin for invalid memory pointers 2026-10-31 08:14:24 +05:30
AdriàandClaude Sonnet 5.5 5c0646737d fix(libkernel): write only the version fields and keep errno in system version queries
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 07:55:32 +05:30
pushkarreddyy 1aae106249 fix(libkernel): return EFAULT from system version queries for invalid memory 2026-10-31 07:53:47 +05:30
Adrià 9eca75175e Merge pull request #13545 from pushkarreddyy/fix/page-table-stats-efault
fix(libkernel): return EFAULT from page table and trace memory stats for invalid memory
2026-10-31 03:16:52 +01:00
Adrià 4b7af94e1d Merge pull request #13537 from pushkarreddyy/fix/sendfile-efault
fix(libkernel): return EFAULT from sendfile for invalid memory pointers
2026-10-31 03:00:47 +01:00
Adrià 41d0d902cc Merge pull request #13532 from relativespace2K/feat/libkernel-kern-proc-proc
feat(libkernel): answer kern.proc.proc with the calling process
2026-10-31 02:57:46 +01:00
Adrià da88f4489a Merge pull request #13544 from cocoa55/fix/mutex-spin-yield-loops
fix(libkernel): spin and yield by the mutex spin and yield loop counts
2026-10-31 02:57:38 +01:00
dantdmdarealguy a0e3da6c49 test(libkernel): run guest_timed_wait_cpu alone on Windows
guest_timed_wait_cpu aborts on the Windows CI runner after printing the
scePthreadCondTimedwait(500 us) CPU line (job 124274871982, main
37277ea18f). The test requires the 99th percentile of each set of waits
under 3 ms and the longest under 10 ms. ctest runs it with --parallel 4
beside tests such as guest_usb_storage, guest_nanosleep_long_request and
the guest_raise tests. Their threads keep the runner's CPUs busy, so a
woken waiter can wait more than a scheduler quantum before it runs: a
failing run measured a 13.25 ms condition wait and a 23.3 ms usleep.

The test now runs with RUN_SERIAL on Windows, as guest_pthread_start and
audio_out2_timing do. The bounds are unchanged.
2026-10-30 20:37:16 -05:00
Florent Combet a6fd9994f7 fix(libkernel): keep close observer registry alive through exit 2026-10-31 02:26:40 +01:00
pushkarreddyy a68bdf41b9 fix(libkernel): return EFAULT from page table and trace memory stats for invalid memory 2026-10-31 02:24:36 +01:00
Adrià a46b04dfe1 fix(libkernel): ignore unwritable sbytes in sendfile and bound iovec allocation 2026-10-31 02:16:45 +01:00
pushkarreddyy ed0892da42 fix(libkernel): return EFAULT from sendfile for invalid memory pointers 2026-10-31 02:16:33 +01:00
infra-rig 5090bcd175 fix(libkernel): select the registered main thread for own-pid scheduling
sched_getparam, sched_getscheduler and sched_setparam with the own pid
from a thread other than the main thread act on the main thread once it
has registered through scePthreadSelf, as FreeBSD's p1003_1b.c selects
the first thread. Before registration, after the main thread exits and
on macOS they still throw.
2026-10-30 16:35:04 -06:00
Florent Combet 1caa5a7cab fix(libkernel): initialize close observer registry on first use 2026-10-30 23:18:28 +01:00
boykopovar 7fcab08f71 Merge pull request #13645 from boykopovar/fix/exception-delivery-race
fix(libkernel): exception delivery race
2026-10-31 01:18:00 +03:00
Adrià 9605300f29 Merge pull request #13503 from Oscar45397/fix/libkernel-map-unallocated-direct-memory
fix(libkernel): return ENOMEM when mapping unallocated direct memory
2026-10-30 22:56:33 +01:00
Adrià 48773cf610 Merge pull request #13443 from DeveshB-1/fix/write-throttling-efault
fix(libkernel): return EFAULT from sceKernelWriteThrottlingStatus for an unwritable store
2026-10-30 22:48:12 +01:00
Adrià db8f5671ab Merge pull request #13444 from DeveshB-1/fix/thermal-sensors-efault
fix(libkernel): return EFAULT from thermal sensor queries for unwritable stores
2026-10-30 22:18:45 +01:00
boykopovar 950b697477 fix(libkernel): preserve exception delivery ownership and alertable drains 2026-10-31 00:13:13 +03:00
mrph28 3b379b4435 feat(libkernel): answer kern.proc.proc with the calling process
MihawkOS (PPSA99170) reads sysctl {1, 14, 8, 0} while it starts and the
runtime throws on the unsupported MIB, which aborts the title.

KERN_PROC_PROC takes no pid, so the node lists the one guest process the
runtime hosts, as the same kinfo_proc kern.proc.pid already builds.

AI-assisted: yes
2026-10-30 18:06:58 -03:00
Adrià 7ad4f3bb9f Merge pull request #12986 from Oscar45397/test/libkernel-virtual-range-name
fix(libkernel): return EFAULT for a null virtual range name
2026-10-30 21:23:57 +01:00
Adrià c0fb4a6aad Merge pull request #13411 from DeveshB-1/fix/uuid-create-efault
fix(libkernel): return EFAULT from sceKernelUuidCreate and sceKernelCreateUuidV4 for unwritable stores
2026-10-30 21:14:40 +01:00
DeveshB-1 84e493242f fix(libkernel): return EFAULT from thermal sensor queries for unwritable stores 2026-10-30 20:51:08 +01:00
cocoa55andClaude Opus 5.5 32abcb15a0 fix(libkernel): try a mutex once before its spin and yield budget
FreeBSD's mutex_lock_common tries the lock before mutex_lock_sleep
spins or yields, so a free mutex with yield loops and no spins was
yielding before its first try here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 15:30:54 -04:00
cocoa55andClaude Opus 5.5 9a7acb3677 fix(libkernel): spin and yield by the mutex spin and yield loop counts
Lock and timed lock now try the mutex up to the spin count with a pause
between tries, then up to the yield count with a yield before each try,
before they block, as FreeBSD 11.4's mutex_lock_sleep does. Trylock and
a lock the thread already holds do not spin. A uniprocessor host skips
the spins and keeps the yields.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 13:56:31 -04:00
Oscar45397andClaude Opus 5.5 06b7a58b1b fix(libkernel): return ENOMEM when mapping unallocated direct memory
Mapping a direct memory range that includes an unallocated physical
page threw std::invalid_argument and ended the process. It now returns
ENOMEM before anything is mapped, as shadPS4's MemoryManager::MapMemory
does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 18:06:45 +01:00
Oscar45397andClaude Opus 5.5 287f43e004 fix(libkernel): return EFAULT for a null virtual range name
KytyPS5 and shadPS4 return EFAULT for a null name. The test keeps that
and the rename and clear checks, and drops the null address, zero length
and past-the-end cases that no reference covers; the debt entry records
them as unknown, with the 32-byte name limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 17:47:22 +01:00
Adrià 9304896d89 Merge pull request #12135 from Oscar45397/fix/libkernel-raise-short-sleep
fix(libkernel): deliver raises at the spin that ends a sleep on Windows
2026-10-30 17:05:05 +01:00
DeveshB-1 5553cbd447 fix(libkernel): return EFAULT from sceKernelWriteThrottlingStatus for an unwritable store 2026-10-30 20:14:03 +05:30
DeveshB-1 3a9719490f fix(libkernel): return EFAULT from sceKernelUuidCreate and sceKernelCreateUuidV4 for unwritable stores 2026-10-30 19:27:53 +05:30
Adrià 96ff704249 Merge pull request #12667 from xdCloudy/feat/libkernel-sys-pthread-attr-helpers
feat(libkernel_sys): implement mutex attribute generation helpers
2026-10-30 14:02:33 +01:00