Files
AnyPS5/docs/dev/debt/changes/docs-libkernel-sysctl-nodes-1360.md

2.6 KiB

libkernel

change [hw.realmem]

  • hw.realmem (libkernel) - sysctl {CTL_HW, 12} and sysctlbyname report the same 8-byte value as hw.physmem (the _SC_PHYS_PAGES pages of 16 KiB), read-only with EPERM for a write and ENOMEM for a short buffer, as FreeBSD's sysctl_hw_realmem does. FreeBSD reports there the memory the firmware describes, which is at least hw.physmem. A payload process on a PS5 (firmware 12.70) gets -1 with ENOENT for hw.physmem and hw.realmem (a read, a size query and a null length) and for {CTL_HW, 5} and {CTL_HW, 12} (a read and a size query); a PS5 Pro payload process (13.60) reproduced every ENOENT and added the write answer: -1 with EPERM for an 8-byte new value on both nodes, so the kernel reaches the permission check where the read lookup fails; hw.usermem64 ({CTL_HW, 13}) reads ENOENT too. What a title process gets was not measured. Dolphin reads it as the machine's memory size in MemPhysical (RetroArch PPSA99169's dolphin_libretro core)

change [vm.overcommit]

  • vm.overcommit (libkernel) - a payload process on a PS5 (firmware 12.70) gets -1 with ENOENT for a read, a size query and a null length, but sysctlbyname here reports the 4-byte value 0, with ENOMEM for a short buffer; a title process was not measured. A write fails with EPERM: the node has no CTLFLAG_PRISON, so sysctl_root needs PRIV_SYSCTL_WRITE, which prison_priv_check denies a jailed root (model agreed on #11216, not measured). A PS5 Pro payload process (13.60) reproduced -1 ENOENT for read, size query and null length, and its sysctlbyname write with a 4-byte new value also answered -1 with ENOENT, not the predicted EPERM (a write to {CTL_HW, 12} in the same session did answer EPERM). In firmware 10.01 kernel data (offsets from VA 0xffffffff82510000) the node is read-write, holds 0 (+0x1f52110) and has an auto-assigned number (+0xdaea28), not FreeBSD's VM_OVERCOMMIT. PS5MC (PPSA99420) reads it at start-up in mimalloc's unix_detect_overcommit, taking 0 as no overcommit