diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2023-12-27 18:36:10 +0000 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2024-02-02 15:58:11 +0000 |
commit | 868c129b90a52f7c30b8a560dc580f851db4b6fc (patch) | |
tree | d32af79194aa7d48dc99ce3ef6059a5328b69da8 | |
parent | c3274a8582b4915efea5a16558e730d362bea177 (diff) | |
download | glibc-868c129b90a52f7c30b8a560dc580f851db4b6fc.tar.gz glibc-868c129b90a52f7c30b8a560dc580f851db4b6fc.tar.xz glibc-868c129b90a52f7c30b8a560dc580f851db4b6fc.zip |
aarch64: Add GCS support to vfork
-rw-r--r-- | sysdeps/unix/sysv/linux/aarch64/vfork.S | 8 |
1 files changed, 7 insertions, 1 deletions
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) |