aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2026-06-11 11:41:29 +0000
committerMark Johnston <markj@FreeBSD.org>2026-06-30 02:31:57 +0000
commite96d0e1fccf5bbc59f43403b4dc7582f4b75ca70 (patch)
treee5f6203ff1b1a8907356cc3312fe7fd6343e0fba
parent0b1dfc94785e1ae263e9334a07fbe2a1ef98c0c9 (diff)
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)
-rw-r--r--sys/arm64/arm64/freebsd32_machdep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arm64/arm64/freebsd32_machdep.c b/sys/arm64/arm64/freebsd32_machdep.c
index 1cf8403e0a0e..dc0e536c2bbc 100644
--- a/sys/arm64/arm64/freebsd32_machdep.c
+++ b/sys/arm64/arm64/freebsd32_machdep.c
@@ -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