[PATCH v5 05/23] aarch64: Add GCS support to vfork

Wilco Dijkstra Wilco.Dijkstra@arm.com
Wed Dec 11 14:15:23 GMT 2024


Hi Yury,

OK. One nit, when you commit, can you improve the comment below?

Cheers,
Wilco

 
From: Szabolcs Nagy <szabolcs.nagy@arm.com>

---
 sysdeps/unix/sysv/linux/aarch64/vfork.S | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S
index e71e492da3..530ae5ea5c 100644
--- a/sysdeps/unix/sysv/linux/aarch64/vfork.S
+++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S
@@ -33,8 +33,11 @@ ENTRY (__vfork)
 
         cmn     x0, #4095
         b.cs    .Lsyscall_error
+       cbz     x0, L(child)
         RET
-
+L(child):
+       /* Return with indirect branch in the child to support GCS.  */

This should also mention that compilers insert BTI after vfork() so that BR works.

+       br      x30
 PSEUDO_END (__vfork)
 libc_hidden_def (__vfork)
 
--
2.39.5


More information about the Libc-alpha mailing list