Commit Graph
64 Commits
Author SHA1 Message Date
Dean 1ede81d911 Merge pull request #11078 from slopgobblercobbler/feat/libkernel-sysconf-limits
feat(libkernel): implement additional sysconf limits
2026-10-27 10:37:14 +13:00
Dean dd87687627 Merge pull request #10671 from pushkarreddyy/feat/libkernel-sys-kernel-queries
feat(libkernel): implement sysKernel update version and mode queries
2026-10-27 10:31:00 +13:00
orezraeyandClaude Opus 5.5 db07b6737d Merge main into fix/libkernel-sysctl-system-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 09:20:00 -03:00
orezraeyandClaude Opus 5.5 82f9806500 test(libkernel): stop requiring unimplemented sysctl MIB forms to throw
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 03:35:10 -03:00
slopgobblercobbler eb54ed35d4 feat(libkernel): implement additional sysconf limits
Implement POSIX / FreeBSD 11.4 limits in sysconf: _SC_CHILD_MAX (2) via getrlimit RLIMIT_NPROC, _SC_NGROUPS_MAX (4) returning 1023 (KERN_NGROUPS), _SC_STREAM_MAX (26) via getrlimit RLIMIT_NOFILE bounded by SHRT_MAX, _SC_HOST_NAME_MAX (72) returning 255 (MAXHOSTNAMELEN - 1), and _SC_LOGIN_NAME_MAX (73) returning 33.
2026-10-25 22:58:38 +01:00
orezraeyandClaude Opus 5.5 65d87b4ecb fix(libkernel): resolve sysctl top-level names and fail absent top-level MIBs with ENOENT as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 17:22:26 -03:00
pushkarreddyy 2ba10cd6bb refactor(libkernel): align sysKernel queries with firmware 13.42 disassembly 2026-10-25 21:07:36 +05:30
pushkarreddyy cbbbb656e6 refactor(libkernel): move sysKernel declarations to public header and clean up test declarations 2026-10-25 14:46:56 +05:30
pushkarreddyy b9df7a6eac test(libkernel): add test cases for sysKernel update version and mode queries 2026-10-25 14:03:12 +05:30
boykopovar fdf9ca7574 fix(sdk): reconcile public headers after rebase 2026-10-24 23:17:47 +03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
orezraeyandClaude Opus 5.5 4064b18e8c Merge main into fix/libkernel-sysctl-system-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 10:10:51 -03:00
Adrià 6cd36e6517 Merge pull request #9794 from Retr0G28/feat/sysctl-kern-boottime
feat(libkernel): answer kern.boottime in sysctl and sysctlbyname
2026-10-24 14:58:01 +02:00
Dean 9a1ea5de1b Merge pull request #10110 from BunnyFl/feat/libkernel-version-trace-queries
feat(libkernel): implement the system-ex version, lower-limit and trace memory queries
2026-10-25 01:53:38 +13:00
orezraeyandClaude Opus 5.5 cb562bb8da Merge main into fix/libkernel-sysctl-system-measured-ps5
Main now returns ENOENT for unknown sysctlbyname and sysctlnametomib names, so the absent-names debt entry no longer says they throw and keeps main's unknown-names entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 16:47:17 -03:00
Hermes Agent 2026238d39 test(libkernel): expect ENOENT for unresolved sysctl names 2026-10-23 12:27:31 -04:00
Hermes Agent 950a21aec8 fix(libkernel): return ENOENT for unknown sysctl names 2026-10-23 12:27:30 -04:00
BunnyFlandClaude Opus 5.5 9aa0f22dc7 feat(libkernel): implement the system-ex version, lower-limit and trace memory queries
sceKernelGetSystemExVersion, sysKernelGetLowerLimitSysexVersion,
sysKernelGetLowerLimitUpdVersion and sceKernelGetTraceMemoryStats were
NotImplemented stubs in libkernel_sys. libkernel, libkernel_sys and
libkernel_web of firmware 13.42 answer them without asking the kernel:
empty strings, a zero version and zero statistics, with the null checks
and return codes the firmware uses, including the plain 22 of
sceKernelGetSystemExVersion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 12:29:49 +02:00
orezraey 4ef70cafab Merge remote-tracking branch 'origin/main' into fix/libkernel-sysctl-system-measured-ps5 2026-10-23 06:54:23 -03:00
orezraeyandClaude Opus 5.5 e385217047 fix(libkernel): report the sysctl system strings and integers a PS5 reports
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 21:03:34 -03:00
Retr0 124dc3b3ac feat(libkernel): answer kern.boottime in sysctl and sysctlbyname
FreeBSD 11.4 serves kern.boottime ({CTL_KERN, KERN_BOOTTIME}) from
sysctl_kern_boottime in sys/kern/kern_tc.c as a read-only 16-byte struct
timeval, so a size query reports 16, a short buffer gets a partial copy
and ENOMEM, and a write gets EPERM from sysctl_root. sysctl, sysctlbyname
and sysctlnametomib now answer it with the guest CLOCK_REALTIME minus
CLOCK_UPTIME, taken at the first read and kept. HotSpot reads it while
writing its error report, which aborted with "unsupported MIB 1.21".
2026-10-22 20:04:05 +03:00
LeandroLP23andClaude Opus 5.5 6e1df42286 feat(libkernel): answer kern.proc.env for the calling process
PS5VR (PPSA99177) reads sysctl {CTL_KERN, KERN_PROC, KERN_PROC_ENV, pid}
for its own pid at start-up and stopped on "unsupported MIB 1.14.35.<pid>".
The call now returns the empty start-up environment that environ and
libc's getenv also begin with, and follows FreeBSD 11's
sysctl_kern_proc_env for the errors: EINVAL for a MIB without exactly one
pid, ESRCH for another pid or -1, EPERM for a write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 14:57:08 +02:00
Hermes Agent 0273c1479f feat(libkernel): expose kern.osreldate sysctl 2026-10-20 18:29:40 -04:00
ionut27001andClaude Opus 5.5 dfa96f1fe6 fix(libkernel): return ENOENT for thirteen sysctl names, as measured on a PS5
In a payload process on a PS5 (firmware 12.70), sysctlbyname returns -1
with ENOENT for thirteen names that threw here, and leaves the buffer and
the length alone, for a read, a size query, a null length and a null
buffer with a null length. sysctl does the same for the fixed MIBs of
seven of them. sysctlnametomib gives those seven MIBs and returns ENOENT
for hw.cacheline_size and hw.usermem, which threw too.

machdep.cacheline_size already returned ENOENT and is now tested with
the others. A write to the new names and MIBs throws, as the console's
answer to a write was not tried. The hw.realmem and vm.overcommit debt
entries now say that a payload process gets ENOENT for them as well.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-20 13:46:29 +02:00
Adrià b9a097353c Merge pull request #7556 from MarcZX10/codex/libkernel-sysctl-mib-enoent
fix(libkernel): return ENOENT for measured absent sysctl MIBs
2026-10-20 13:23:08 +02:00
MarcZX10 99e87ce36f test(libkernel): avoid flaky random byte assertion 2026-10-20 12:29:39 +02:00
MarcZX100 7b05271abb fix(libkernel): support kern.rng_pseudo MIB access 2026-10-20 12:29:39 +02:00
Adrià 9299e6fd8a Merge pull request #7542 from ionut27001/fix/libkernel-rng-pseudo-block
fix(libkernel): return kern.rng_pseudo in 64-byte blocks as measured on a PS5
2026-10-20 12:24:51 +02:00
MarcZX10 e054c83eea Merge upstream main into measured absent sysctl MIBs 2026-10-20 10:12:56 +00:00
Adrià a77e40f93f Merge pull request #7070 from milescoviello/feat/kern-proc-vmmap
feat(libkernel): report the guest address-space map through kern.proc.vmmap
2026-10-19 19:36:11 +02:00
ionut27001andClaude Opus 5.5 dca67ae477 fix(libkernel): return kern.rng_pseudo in 64-byte blocks as measured on a PS5
In a payload process on a PS5 (firmware 12.70),
sysctlbyname("kern.rng_pseudo") answers a size query with 64 and gives
at most 64 bytes per call, up to a 65536-byte buffer. A buffer smaller
than 64 bytes gets as many bytes as its length and a null length gets
none, both with -1 and ENOMEM; a null buffer with a null length returns
0, and errno is kept when the call succeeds. Here the whole buffer was
filled, a size query threw and the length was never changed. The 64
random bytes are now drawn only for a read that passes both a buffer
and a length.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:49:39 +03:00
Adrià 62e946f114 Merge pull request #6833 from ErenYeager1836/feat/libkernel-sysconf-limits
feat(libkernel): support _SC_ARG_MAX, _SC_OPEN_MAX and _SC_IOV_MAX in sysconf
2026-10-19 13:37:44 +02:00
Adrià b8cd204a3f Merge pull request #6220 from DavidSamir/fix/libkernel-sysctl-kern-ostype
feat(libkernel): answer the uname sysctl names
2026-10-18 21:56:01 +02:00
MarcZX100 8e2f71263c fix(libkernel): return ENOENT for measured sysctl MIBs 2026-10-18 18:13:05 +00:00
milescovielloandClaude Opus 5.5 20764888c3 feat(libkernel): report the guest address-space map through kern.proc.vmmap
sysctl {CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, pid} for the calling process
returns packed FreeBSD 11 kinfo_vmentry records, one per used range of the
guest arena, with the protection sceKernelVirtualQuery reports. Other pids
return ESRCH, a write EPERM, a short buffer ENOMEM. GuestArena gains a
query for the used range at or after an address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-17 20:43:31 +00:00
Nithishvelan M 76e05544a9 feat(libkernel): report hw.pagesize through sysctl and sysctlnametomib 2026-10-16 20:55:46 +02:00
Nithishvelan M 301fdbe923 feat(libkernel): return getrlimit soft limit for _SC_OPEN_MAX in sysconf 2026-10-16 23:17:43 +05:30
Nithishvelan M 2e4f63b816 feat(libkernel): support _SC_ARG_MAX, _SC_OPEN_MAX and _SC_IOV_MAX in sysconf 2026-10-16 19:14:09 +05:30
David 8cda5ec0a1 test(libkernel): cover the uname names through sysctlbyname and sysctlnametomib 2026-10-15 08:38:54 +04:00
David 364f9749b7 test(libkernel): cover the uname names through sysctl
For each of the five: the size query, the value, a short buffer (ENOMEM, the copied prefix kept), a new value (EPERM) and a trailing name component (ENOTDIR).
2026-10-15 08:38:52 +04:00
AhmadandClaude Opus 5.5 cc3d25d636 feat(libkernel): implement sysctlnametomib for the sysctl names AnyPS5 serves
Map hw.model, hw.ncpu, hw.physmem, hw.realmem, kern.arandom and
kern.proc.pathname to their FreeBSD MIBs with the size handling of
FreeBSD's libc wrapper over name2oid, fail with ENOENT and ENAMETOOLONG
as name2oid does, and throw for null pointers, which FreeBSD's wrapper
dereferences, and for names sysctl does not serve.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 10:53:04 +03:00
Dean ea53213fd4 Merge pull request #4674 from zaydzaari/research/kernel-system-version-size-1342
fix(libkernel): accept measured system version record values
2026-10-14 19:06:34 +13:00
Dean a31043146e Merge pull request #5367 from MarcZX100/marc/sysctl-leaf-enotdir-5356
fix(libkernel): return ENOTDIR for trailing sysctl leaf components
2026-10-14 16:41:21 +13:00
p3nicillinandClaude Opus 5.5 dad29cac43 feat(libkernel): report vm.overcommit through sysctlbyname
The mimalloc in PS5MC (PPSA99420) reads vm.overcommit at start-up and
stopped on the unsupported name. It reports FreeBSD's default, 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 14:44:48 +13:00
Dean dff25dd604 Merge pull request #5098 from p3n1cillin/claude/sysctl-hw-realmem
feat(libkernel): report hw.realmem through sysctl
2026-10-14 14:44:32 +13:00
Dean 1ebf8410a9 Merge pull request #5351 from MarcZX100/marc/fix-pathname-sysctl-eperm-5340
fix(libkernel): return EPERM before validating pathname sysctl MIB
2026-10-14 14:26:31 +13:00
p3nicillinandClaude Opus 5.5 fe54938490 feat(libkernel): report hw.realmem through sysctl
The dolphin_libretro core of RetroArch (PPSA99169) reads {CTL_HW,
HW_REALMEM} as the machine's memory size and stopped on the unsupported
MIB. It reports the same value as hw.physmem.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 14:23:55 +13:00
Dean fc1e388ed2 Merge pull request #5185 from p3n1cillin/claude/sysconf-clk-tck
feat(libkernel): report _SC_CLK_TCK through sysconf
2026-10-14 14:22:06 +13:00
Hussein Kadhim 091438f99b fix(libkernel): fail sysctl with ENOTDIR when a leaf MIB has a trailing component
FreeBSD sysctl_find_oid returns ENOTDIR when the MIB continues below a leaf object. The supported hw.ncpu, hw.model, hw.physmem and kern.arandom MIBs threw an unsupported MIB error instead.

(cherry picked from commit 6968aea8af578c4d56dc614cbe449274bb6e76e7)
2026-10-13 21:33:25 +00:00
Hussein Kadhim 2096410b29 fix(libkernel): report EPERM before EINVAL when writing kern.proc.pathname
FreeBSD sysctl_root rejects a write to a read-only node with EPERM before the node handler checks the MIB length, so a write with a short or long kern.proc.pathname MIB fails with EPERM. sysctlbyname for kern.proc.pathname now goes through sysctl with its 3-component MIB so it follows the same order.
2026-10-13 17:39:56 +00:00