git: a397b5508320 - main - linux: implement set_cloned_tls() on arm64
Edward Tomasz Napierala
trasz at FreeBSD.org
Wed Jun 16 10:33:33 UTC 2021
The branch main has been updated by trasz:
URL: https://cgit.FreeBSD.org/src/commit/?id=a397b5508320e757274bc652b43ccb2e1a702933
commit a397b5508320e757274bc652b43ccb2e1a702933
Author: Edward Tomasz Napierala <trasz at FreeBSD.org>
AuthorDate: 2021-06-16 09:34:06 +0000
Commit: Edward Tomasz Napierala <trasz at FreeBSD.org>
CommitDate: 2021-06-16 10:32:39 +0000
linux: implement set_cloned_tls() on arm64
This fixes random segfaults on "git commit --amend".
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30508
---
sys/arm64/linux/linux_machdep.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/sys/arm64/linux/linux_machdep.c b/sys/arm64/linux/linux_machdep.c
index 80597a2922a7..8e10fc9d26a1 100644
--- a/sys/arm64/linux/linux_machdep.c
+++ b/sys/arm64/linux/linux_machdep.c
@@ -55,7 +55,6 @@ LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE);
LIN_SDT_PROBE_DEFINE0(machdep, linux_mmap2, todo);
LIN_SDT_PROBE_DEFINE0(machdep, linux_rt_sigsuspend, todo);
LIN_SDT_PROBE_DEFINE0(machdep, linux_sigaltstack, todo);
-LIN_SDT_PROBE_DEFINE0(machdep, linux_set_cloned_tls, todo);
/*
* LINUXTODO: deduplicate; linux_execve is common across archs, except that on
@@ -141,11 +140,12 @@ linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap)
return (EDOOFUS);
}
-/* LINUXTODO: implement arm64 linux_set_cloned_tls */
int
linux_set_cloned_tls(struct thread *td, void *desc)
{
- LIN_SDT_PROBE0(machdep, linux_set_cloned_tls, todo);
- return (EDOOFUS);
+ if ((uint64_t)desc >= VM_MAXUSER_ADDRESS)
+ return (EPERM);
+
+ return (cpu_set_user_tls(td, desc));
}
More information about the dev-commits-src-main
mailing list