71 Commits
Author SHA1 Message Date
Dean 846ae118f9 Merge pull request #11861 from ionut27001/fix/libkernel-sysconf-measured-names
fix(libkernel): sysconf answers the names a PS5 payload process answers
2026-10-28 22:52:41 +13:00
ionut27001 e984b14b3f fix(libkernel): sysconf answers the names a PS5 payload process answers 2026-10-27 12:00:08 +02:00
GruzzberryandClaude Sonnet 5.5 4d8fa35a5e fix(libkernel): fail sysctl and sysctlbyname with EFAULT on an unreadable or unwritable pointer
FreeBSD 11.4's sys___sysctl and userland_sysctl copy the name and the
old length in, and copy the value and the length out, so a bad pointer
gives EFAULT in that order. sysctl dereferenced them directly, and
sysctlbyname read its name with strcmp.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-27 08:30:17 +01:00
Dean 2da4d74cac Merge pull request #11025 from orezraey/fix/libkernel-sw-version-block-measured-ps5
fix(libkernel): accept any block size and a null block in the system software version getters as measured on a PS5
2026-10-27 10:59:21 +13:00
Dean 3c4aab5acc Merge pull request #10830 from babyhuey/feat/libkernel-kern-proc-pid
feat(libkernel): answer kern.proc.pid for the calling process
2026-10-27 10:54:49 +13:00
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
orezraeyandClaude Opus 5.5 92448b72f9 fix(libkernel): accept any block size and a null block in the system software version getters as measured on a PS5
On PS5 firmware 13.60 sceKernelGetProsperoSystemSwVersion and
sceKernelGetSystemSwVersion return 0 for every value in the leading size
field, keep it, write the string and the packed version, and return 0
without writing for a null block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 11:19:52 -03:00
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
babyhuey cf950fac5d feat(libkernel): answer kern.proc.pid for the calling process
Source Port (PPSA20040) checks whether a debugger is attached with
sysctl {CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()} into a 1,088-byte
buffer and tests P_TRACED (0x800) in ki_flag at offset 0x170; the MIB was
unsupported, so the title threw at start-up. Return a FreeBSD 11 amd64
kinfo_proc for the calling process with ki_structsize, ki_pid, ki_ppid and
ki_comm filled and every other field 0, so P_TRACED is clear. Like
kern.proc.vmmap, any other pid fails with ESRCH, a write with EPERM and a
short buffer with ENOMEM. The rest of the record is not measured on a
console and is recorded as debt.
2026-10-24 21:57:59 -04:00
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