[Kernel] Validate pthread stack bounds before reporting them

Co-authored-by: Sekai <140012992+igettingit@users.noreply.github.com>
This commit is contained in:
ParantezTech 2026-10-06 13:44:48 +03:00
parent 0b41146cd3
commit b8a5155d17
1 changed files with 5 additions and 0 deletions

View File

@ -574,6 +574,11 @@ public static class KernelPthreadExtendedCompatExports
return (int)OrbisGen2Result.ORBIS_GEN2_OK;
}
private static bool IsValidStackBounds(ulong stackAddress, ulong stackSize) =>
stackAddress != 0 &&
stackSize != 0 &&
stackAddress <= ulong.MaxValue - stackSize;
private static bool TryInferNativeGuestStack(ulong stackPointer, out ulong stackAddress)
{
stackAddress = 0;