]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
aarch64: Add GCS support to vfork
authorSzabolcs Nagy <szabolcs.nagy@arm.com>
Wed, 27 Dec 2023 18:36:10 +0000 (18:36 +0000)
committerYury Khrustalev <yury.khrustalev@arm.com>
Thu, 10 Oct 2024 12:40:35 +0000 (13:40 +0100)
sysdeps/unix/sysv/linux/aarch64/vfork.S

index e71e492da339b25a8d05065fccca96e2c2e405d3..cfaf4a1ffbe5590766c8031766de93058dbcaea8 100644 (file)
@@ -33,8 +33,14 @@ 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.
+          Clear x30 to crash early if the child tries to ret.  */
+       mov     x1, x30
+       mov     x30, 0
+       br      x1
 PSEUDO_END (__vfork)
 libc_hidden_def (__vfork)