From: Szabolcs Nagy Date: Wed, 27 Dec 2023 18:36:10 +0000 (+0000) Subject: aarch64: Add GCS support to vfork X-Git-Tag: glibc-2.41~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1cf59c2603be88e3c97e68b1f219647f20310215;p=thirdparty%2Fglibc.git aarch64: Add GCS support to vfork Reviewed-by: Wilco Dijkstra Reviewed-by: Carlos O'Donell --- diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S index 27618567f1..d5943a7485 100644 --- a/sysdeps/unix/sysv/linux/aarch64/vfork.S +++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S @@ -33,8 +33,13 @@ 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. + Compilers insert BTI instruction after vfork() to make + sure return via BR works on systems with BTI. */ + br x30 PSEUDO_END (__vfork) libc_hidden_def (__vfork)