sys/arm64: fix return values of freebsd32_{set,swap}context()

This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.

In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.

Approved by:	so
Security:	FreeBSD-EN-26:16.arm64
Tested by:	fuz
MFC after:	1 week

(cherry picked from commit 92ae21e8a155734f73589b7ef9fa19a6bb6d042f)
(cherry picked from commit 58a15fe75cc59a73016f00069f2dad001d798edf)
This commit is contained in:
Piotr Kubaj 2026-06-11 13:41:29 +02:00 • committed by Franco Fichtner
parent 0101c21cac
commit 06625b6800

View file

@ -292,7 +292,7 @@ freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap)
NULL, 0);
}
}
return (ret);
return (ret == 0 ? EJUSTRETURN : ret);
}
int
@ -340,7 +340,7 @@ freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap)
}
}
}
return (ret);
return (ret == 0 ? EJUSTRETURN : ret);
}
void