|
|
Message-ID: <695e0e3a-dfc5-4074-a3f2-7feacd1d5eb6@foss.arm.com>
Date: Thu, 18 Dec 2025 04:33:58 -0600
From: Bill Roberts <bill.roberts@...s.arm.com>
To: musl@...ts.openwall.com, Florian Weimer <fweimer@...hat.com>,
Bill Roberts <bill.roberts@....com>
Subject: Re: [RFC 03/14] aarch64: rewrite vfork routine in C using
inline asm
On 12/11/25 6:09 AM, Florian Weimer wrote:
> * Bill Roberts:
>
>> diff --git a/src/process/aarch64/vfork.c b/src/process/aarch64/vfork.c
>> new file mode 100644
>> index 00000000..87ec8ebf
>> --- /dev/null
>> +++ b/src/process/aarch64/vfork.c
>> @@ -0,0 +1,21 @@
>> +#include <sys/types.h>
>> +
>> +#include "syscall.h"
>> +
>> +pid_t vfork(void)
>> +{
>> + /* aarch64 Linux syscall: x8 = nr, x0..x5 = args, ret in x0 */
>> + register long x8 __asm__("x8") = 220; /* SYS_clone */
>> + register long x0 __asm__("x0") = 0x4111; /* SIGCHLD | CLONE_VM | CLONE_VFORK */
>> + register long x1 __asm__("x1") = 0; /* arg2 = 0 */
>> +
>> + __asm__ volatile (
>> + "svc 0\n\t"
>> + ".hidden __syscall_ret\n\t"
>> + "b __syscall_ret\n\t"
>> + : "+r"(x0) /* x0 = in/out */
>> + : "r"(x1), "r"(x8) /* inputs */
>> + : "memory", "cc"
>> + );
>> + __builtin_unreachable();
>> +}
>
> This is incompatible with building with -fstack-protector-all, isn't it?
>
Yeah if the compiler emits the prologue with the canary, the tail call
to __syscall_ret would break that.
> Thanks,
> Florian
>
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.