Commit Graph
32 Commits
Author SHA1 Message Date
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 <noreply@anthropic.com>
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
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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
p3nicillinandClaude Opus 5.5 72a685b906 feat(libkernel): report _SC_CLK_TCK through sysconf
The Python in PS5MC (PPSA99420) reads sysconf(_SC_CLK_TCK) while
importing its posix module and failed with "cannot read
ticks_per_second". It returns FreeBSD's CLK_TCK, 128.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:53:24 +01:00
babyhuey d39cb2c62f feat(libkernel): report machdep.tsc_freq from sysctlbyname 2026-10-13 01:18:43 -04:00
babyhuey c69eb7027d feat(libkernel): report hw.model from sysctl 2026-10-12 16:18:42 -04:00
Zayd Zaari ed56cff790 fix(libkernel): accept measured system version record values
Preserve the leading field and bytes after the 40-byte legacy version record for the values measured in four PS5 firmware 13.42 hardware runs. Keep the emulator version policy unchanged and leave the separately proposed Prospero correction out of scope.

AI-assisted; regression tests are based on guarded hardware measurements.
2026-10-12 19:02:03 +00:00
pushkarreddyy d8b42473d7 feat(libkernel): support MIB 1.37 (kern.arandom) in sysctl 2026-10-12 12:07:45 +05:30
pushkarreddyy 726e773417 feat(libkernel): support kern.sdk_version in sysctlbyname 2026-10-12 11:53:41 +13:00
pushkarreddyy 931aaa2a7e feat(libkernel): handle sysctl queries for pathname, physmem and cacheline size 2026-10-12 00:17:14 +02:00
Hannah Lyons 04835bdcd1 feat(libkernel): support kern.rng_pseudo in sysctlbyname 2026-10-11 09:51:22 +02:00
MarcZX100 d8ba169df8 fix(libkernel): correct system version ABI layout 2026-10-11 09:43:02 +02:00
pushkarreddyy cbacc46ede fix(libkernel): return SCE_KERNEL_ERROR codes in sceKernelGetSystemSwVersion 2026-10-11 09:42:49 +02:00
pushkarreddyy 5890160278 feat(libkernel): implement sceKernelGetSystemSwVersion
(cherry picked from commit 7143d0b46e)
2026-10-11 09:42:49 +02:00
LeandroLP23andClaude Opus 5.5 a3f0120da2 feat(libkernel): export environ as an empty environment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 23:22:58 +02:00
overlordxrz-source 18798620e8 feat(libkernel): implement sysctl and sysctlbyname for hw.ncpu
ScreenTester5 (PPSA69420) stops at start-up on the unresolved sysctlbyname
import and also imports sysctl. hw.ncpu (CTL_HW.HW_NCPU) reports the same
processor count as sysconf(_SC_NPROCESSORS_ONLN). Other names and MIBs throw.
2026-10-08 12:23:05 -04:00
SamG-Coder cbd22dd854 feat(kernel): implement guest system configuration queries 2026-09-25 06:25:16 +10:00