Commit Graph
529 Commits
Author SHA1 Message Date
bluandClaude Opus 5.5 24497b2406 Merge branch 'main' into refactor/siginterrupt-libc-internal
Resolves docs/dev/debt/libkernel.md: main's sigaction entry (SIGPIPE outside Windows) and this branch's signal entry, which points to libSceLibcInternal for siginterrupt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-03 10:23:38 -07:00
Dean Galvin a39b825599 Merge commit 'd1ae628bc2f62459cce1e9872ba5632c938c71f2' into HEAD
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-11-03 18:18:49 +13:00
Dean b955001c4d Merge pull request #15030 from Gruzzberry/fix/sysctl-overcommit-eperm
fix(libkernel): fail a vm.overcommit write with EPERM
2026-11-03 18:13:26 +13:00
Dean 48dd279a37 Merge pull request #13950 from pushkarreddyy/fix/usercontext-efault
fix(libkernel): return EFAULT from context operations for invalid memory pointers
2026-11-03 18:09:35 +13:00
Dean 4c1ceccd9b Merge pull request #14591 from ahmadmuj/fix/anyps5-sysctl-proc-name
fix(libkernel): resolve kern.proc.proc by name
2026-11-03 11:39:54 +13:00
pushkarreddyy 1b2d0d2ace fix(libkernel): copy in UC_COPY_SIZE bytes in setcontext matching FreeBSD 2026-11-02 22:17:28 +05:30
pushkarreddyy a7fa0e3fad fix(libkernel): return EFAULT from context operations for invalid memory pointers 2026-11-02 22:17:28 +05:30
Dean b052a9307b Merge pull request #12005 from akkadbakkad89/exception-drain-mailbox
fix(libkernel): post guest raises to the delivery drain mailbox on Windows
2026-11-03 01:29:04 +13:00
Dean a645efee3b Merge pull request #11851 from LeandroLP23/fix/alarm-precise-timed-wait
fix(libkernel): wait for alarm and setitimer expiries with the precise timed wait on Windows
2026-11-03 01:27:22 +13:00
bluandClaude Opus 5.5 dae55d9e12 Merge branch 'main' into refactor/siginterrupt-libc-internal
Resolves docs/dev/debt/libc.md: main's updated _Thrd entry, and siginterrupt stays documented in libSceLibcInternal.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-02 04:12:04 -07:00
GruzzberryandClaude Sonnet 5.5 0dd9641bab fix(libkernel): fail a vm.overcommit write with EPERM
vm.overcommit is a read-write sysctl without CTLFLAG_PRISON, so FreeBSD 11.4 sysctl_root asks priv_check for PRIV_SYSCTL_WRITE before the handler runs, and prison_priv_check denies it to a jailed root. Under the credential model agreed on #11216 a write through sysctlbyname now fails with EPERM, whatever the value or its length, instead of throwing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-02 10:48:01 +00:00
Dean ed08af6a2f Merge pull request #10953 from AZLisme/feat/batch2-libc-legacy-signals
fix(libSceLibcInternal): export sigvec through shared runtime
2026-11-02 23:25:28 +13:00
Dean b07388b060 Merge pull request #10552 from krishalivaibhav/fix/macos-libkernel-six
fix(libkernel): build the file, module and rtld calls on macOS hosts
2026-11-02 20:54:13 +13:00
bluandClaude Opus 5.5 d984a64ceb Merge branch 'main' into refactor/siginterrupt-libc-internal
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 16:22:33 -07:00
Ahmad Mujahid 00f69414ba fix(libkernel): resolve kern.proc.proc by name
sysctl serves {1, 14, 8} since #13532, but sysctlbyname and sysctlnametomib still returned ENOENT for kern.proc.proc. Map the name to the same MIB, as FreeBSD's name lookup does.
2026-11-01 19:24:55 +04:00
akkadbakkad89 2189fb06ea fix(libkernel): retire delivery-drain posts against a finished target
QueueForDeliveryDrain ran after ResumeThread with no coordination with
the target's final ReapDeliveryDrain: a target could exit between resume
and enqueue, leaving the post in a box nothing would drain again and
retaining the QueuedDelivery reference.

Admission is now decided under drainBoxesLock against the target's
_finished flag, which is stored before the final reap in program order;
denied posts run their callback inline so the entry and the reference
are resolved exactly once on either path.

The GuestRaiseException regression arms a post hook, holds the producer
between resume and enqueue, lets the target finish and reap, then
completes the post and requires the drain to stay empty; the churn
rounds also assert the post hook observed mailbox posts alongside the
delivered raises.
2026-11-01 18:30:44 +05:30
Dean Galvin ec3b5d9c46 Merge commit 'a644edf30c501a612d06f17d05ef1b7051350cef' into HEAD
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-11-01 23:26:11 +13:00
AZLisme e7725d7111 feat(libc): implement shared legacy sigvec support 2026-11-01 17:21:10 +08:00
akkadbakkad89andDevin 7ff3b7091b fix(libkernel): post guest raises to the delivery drain mailbox on Windows
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-01 13:23:10 +05:30
GruzzberryandClaude Sonnet 5.5 5ba892d391 fix(libkernel): fail rtprio_thread, sched_setscheduler and setpriority with the jail privilege errors
A title is jailed (agreed on #11216). FreeBSD 11.4 prison_priv_check denies
PRIV_SCHED_RTPRIO, PRIV_SCHED_SET and PRIV_SCHED_SETPRIORITY to a jailed caller.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 07:56:25 +01:00
Adrià 4547df009b Merge pull request #13874 from DeveshB-1/fix/sysarch-efault
fix(libkernel): return EFAULT from sysarch for invalid memory pointers
2026-11-01 06:47:19 +01:00
Adrià f377753dd2 Merge pull request #13854 from DeveshB-1/fix/sysctlnametomib-efault
fix(libkernel): return EFAULT from sysctlnametomib for invalid memory pointers
2026-11-01 06:05:23 +01:00
DeveshB-1 5d736ad55b fix(libkernel): return EFAULT from sysarch for invalid memory pointers 2026-11-01 05:55:56 +01:00
Dean 90a01f0770 Merge pull request #13824 from zaryabzip/feat/sysutil-notification-with-text
feat(libSceSysUtil): send text notifications as firmware 13.42 does
2026-11-01 14:24:52 +13:00
Adrià 666d9b10a5 Merge pull request #13790 from DeveshB-1/fix/allowed-sdk-version-efault
fix(libkernel): return EFAULT from sceKernelGetAllowedSdkVersionOnSystem for an unwritable store
2026-11-01 02:23:24 +01:00
Adrià cd35d6103a Merge pull request #13798 from pushkarreddyy/fix/app-info-efault
fix(libkernel): return EFAULT from sceKernelGetAppInfo for invalid memory pointers
2026-11-01 02:22:03 +01:00
Adrià 8bf03654ed Merge pull request #13769 from Flamefusion/feat/libkernel-has-trinity-mode
feat(libkernel): implement sceKernelHasTrinityMode for a base PS5
2026-11-01 00:54:50 +01:00
Adrià 3f6c712b77 Merge pull request #13746 from Gruzzberry/fix/prot-group-pgid-errnos
fix(libkernel): match FreeBSD 11.4 getgroups size and setgroups limit
2026-11-01 00:53:56 +01:00
DeveshB-1 dca2c61801 fix(libkernel): return EFAULT from sceKernelGetAllowedSdkVersionOnSystem for an unwritable store 2026-10-31 23:49:53 +01:00
DeveshB-1 dd46d6ada3 fix(libkernel): return EFAULT from sysctlnametomib for invalid memory pointers 2026-10-31 15:02:53 +05:30
blu 68a0d205c0 Merge remote-tracking branch 'origin/main' into refactor/siginterrupt-libc-internal 2026-10-31 02:05:49 -07:00
krishalivaibhavandClaude Sonnet 5.5 74cfbed70d fix(libkernel): return null for an address outside every image on macOS
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
0e145b86e1 fix(libkernel): build the file, module and rtld calls on macOS hosts
NativeStat, SharedMemory, Stdio, DynamicLoader, ModuleInfo and Rtld used
Linux-only APIs (st_atim, memfd_create, sys/vfs.h, link.h and dl_iterate_phdr),
so libkernel did not compile on macOS. Add macOS paths behind __APPLE__:
st_*timespec and a long-path fstatat walk, an unlinked temp file for shared
memory, statfs, dlopen/dladdr and Mach-O segment walks for module and rtld
queries. The Linux and Windows paths are unchanged.

Extracted from feat/macos-port (#8658).

Co-authored-by: Himansh Raj <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 14:32:53 +05:30
zaryabzip 520a8249a3 feat(libSceSysUtil): send text notifications as firmware 13.42 does
sceSysUtilSendSystemNotificationWithText builds the 0xc30-byte request
the 13.42 library builds (kind 5, the type at +0xc, at most 179
characters of text at +0x2d, an empty text for a null message) and
returns what sceKernelSendNotificationRequest returns. That call now
prints kind 5 requests as it prints kind 0 ones.

Replaces #9081 by @shanu337.
2026-10-31 13:13:56 +05:00
pushkarreddyy 16b53200f3 fix(libkernel): preserve caller errno across sceKernelGetAppInfo guest memory write 2026-10-31 12:58:28 +05:30
pushkarreddyy d60500a34b fix(libkernel): return EFAULT from sceKernelGetAppInfo for invalid memory pointers 2026-10-31 12:52:31 +05:30
Flamefusion 7b477b6d66 feat(libkernel): implement sceKernelHasTrinityMode for a base PS5
sceKernelHasTrinityMode returns 0, the answer of a base PS5, as
sceKernelIsTrinityMode already does. Two public readings of firmware
libkernel (OpenAGC for 11.60, Backport for 11.00 to 12.70) say it
compares hw.sce_main_socid with its low five bits cleared against
0x840fc0; the base PS5 SoC id recorded for sceKernelGetMainSocId,
0x840f80, fails that test. The prototype int (void) comes from the 23
calls in a UE5 title, each storing setne of the result in a guarded
static with no argument set up.

Titles import it from libkernel, but only the libkernel_sys placeholder
inventory exported it, as a throwing stub. The export moves to libkernel
next to sceKernelIsTrinityMode, and the inventory and its counts drop
the entry. guest_operation_mode checks the result.
2026-10-31 10:42:24 +05:30
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
GruzzberryandClaude Sonnet 5.5 6787b7fa8d fix(libkernel): match FreeBSD 11.4 getgroups size and setgroups limit
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 03:18:40 +00: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 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à 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
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à 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