From: Szabolcs Nagy Date: Wed, 27 Dec 2023 18:36:10 +0000 (+0000) Subject: aarch64: Add GCS support to vfork X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b2f9ca4e7b1970fe5b7a9e2f82b38a37bdcd851;p=thirdparty%2Fglibc.git aarch64: Add GCS support to vfork --- diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S index e71e492da3..cfaf4a1ffb 100644 --- a/sysdeps/unix/sysv/linux/aarch64/vfork.S +++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S @@ -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)