Measured on firmware 13.60: sceKernelMprotect, mprotect and
sceKernelMtypeprotect on direct memory change the mapped parts of a
range and return 0 also when the range starts in a gap or is wholly
unmapped; sceKernelMtypeprotect retypes only the mapped pages. The batch
map and memory pool protect operations keep their unmeasured EINVAL.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
mprotect already returns 0 for a zero length. The sceKernel entry
points passed it to DoMprotect, which throws for an empty range.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The allocation tracker threw a runtime_error (a hole in the protected range) from inside
sceKernelMprotect, which terminated the title. mprotect already turned the exception into
EINVAL. sceKernelMprotect and sceKernelMtypeprotect now check that the range is registered
first and return EINVAL; the retype of direct mappings is skipped on failure.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>