Commit Graph
3 Commits
Author SHA1 Message Date
ionut27001andClaude Opus 5.5 213a741eb2 fix(libkernel): match inet_ntop and inet_pton padding and null pointers as measured on a PS5
Measured from a payload process on a PS5 (firmware 12.70), where
__inet_ntop/__inet_pton and the plain inet_ntop/inet_pton exports
resolve to the same functions:
- inet_ntop follows an AF_INET6 result with zero bytes up to size (sizes
  4 to 65536 sampled) and never writes past size; AF_INET writes only the
  text and its NUL.
- An unsupported family returns EAFNOSUPPORT first, even with null
  pointers.
- A null source or text raises SIGSEGV during the call, before the size
  is checked; here it throws instead of returning EFAULT.
- A null destination is reached only after the size check and the text
  parse: ENOSPC for a size that is too small, 0 for text that does not
  parse, and SIGSEGV (a throw here) otherwise.
The test pins the measured inet_pton and inet_ntop rows, including all
inputs the existing assertions use. The text-form debt entry is replaced
by one that records what a payload process measured (the text forms, the
order of the checks and the padding) and what is still assumed: the
sizes that were not sampled, sizes above 65536, and a title process.
inet_ntoa_r calls __inet_ntop, so a null inet_ntoa_r buffer with room
for the text now throws, and a null buffer that is too small sets ENOSPC
instead of EFAULT; the libSceLibcInternal debt entry says so.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:02:40 +03:00
Hussein Kadhim d4301cf9b3 fix(libkernel): parse and print inet text addresses by the guest rules
inet_pton and inet_ntop no longer call the host resolver library, whose
accepted forms and output differ from the guest's (leading zeros,
zone ids, IPv4-embedded printing).

(cherry picked from commit 058d808ae7)
2026-10-11 12:46:21 +00:00
SamG-Coder ff725218cb feat(kernel): translate guest IP address conversion APIs 2026-09-25 06:18:32 +10:00