aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2025-10-21 21:35:24 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2025-10-22 12:24:41 +0000
commit1ca09538d94273601dac08204c1d0b3ca9115864 (patch)
tree2d1363f772d4ff6ad755b5361c42db29359d6a1d
parent2b2a4f02e0872065c63baec8bf0069e3b677def7 (diff)
sys/arm64: fix COMPAT_FREEBSD32 __syscall()
It seems like _QUAD_LOWWORD was incorrectly expanded into 1, which is correct for big endian but not little endian. This means we always grab the padding word for the syscall number, which is usually 0, causing SIGSYS to be delivered to the caller. Reintroduce _QUAD_LOWWORD to fix the syscall. PR: 290411 MFC after: 1 week Discussed with: jrtc27 Reviewed by: cognet, emaste Approved by: markj (mentor) Fixes: 8c9c3144ccfa3061879b8cec015ee7d1010e4766 Differential Revision: https://reviews.freebsd.org/D53250
-rw-r--r--sys/arm64/arm64/elf32_machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/arm64/arm64/elf32_machdep.c b/sys/arm64/arm64/elf32_machdep.c
index 8f8a934ad520..4cb8ee5f57ef 100644
--- a/sys/arm64/arm64/elf32_machdep.c
+++ b/sys/arm64/arm64/elf32_machdep.c
@@ -210,7 +210,7 @@ freebsd32_fetch_syscall_args(struct thread *td)
sa->code = *ap++;
nap--;
} else if (sa->code == SYS___syscall) {
- sa->code = ap[1];
+ sa->code = ap[_QUAD_LOWWORD];
nap -= 2;
ap += 2;
}