Files
AnyPS5/docs/dev/debt/changes/fix-libkernel-sysctl-name2oid.md
KianandClaude Opus 5.5 86f7f1c80a fix(libkernel): answer sysctl {0, 3} name2oid, as FreeBSD 11.4 does
sysctl({0, 3}) threw for every call. It now reads the name from the new
value as FreeBSD 11.4's sysctl_sysctl_name2oid does: no name gives ENOENT,
1024 bytes or more give ENAMETOOLONG and the name ends at the first NUL.
The name resolves through sysctlnametomib, which FreeBSD's libc implements
as this {0, 3} call, and the OID goes out through the copy-out the other
nodes use, with ENOMEM and a partial copy for a short buffer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 03:14:57 +10:00

1.0 KiB

libkernel

change [Unknown sysctl names and MIBs]

  • Unknown sysctl names and MIBs (libkernel) - a numeric MIB under a known top-level node, or under one of 256 or more (where FreeBSD numbers dynamic nodes), that is not implemented throws, where a payload process on PS5 firmware 13.60 gets ENOENT for {1, 9999}, {6, 9999}, {0, 9999}, {1, 14, 9999, pid} and 24 levels starting {1, 9999}, since an unimplemented MIB here may exist there. A top-level node below 0 or from 10 to 255 gets ENOENT with the buffer and length untouched, as {99, 1} did there. Unrecognized names get ENOENT through sysctlbyname, sysctlnametomib and {0, 3}, as kern.anyps5.x did; {0, 3} knows the same names and was not called directly. The ten FreeBSD top-level names (sysctl to p1003_1b), with or without a trailing dot, map to one level, and sysctlbyname fails them with EINVAL; a name of 1024 bytes or more gets ENAMETOOLONG, as measured for kern and kern.