Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lhutsxxxlrl.fsf@oldenburg.str.redhat.com>
Date: Thu, 11 Dec 2025 13:09:50 +0100
From: Florian Weimer <fweimer@...hat.com>
To: Bill Roberts <bill.roberts@....com>
Cc: musl@...ts.openwall.com
Subject: Re: [RFC 03/14] aarch64: rewrite vfork routine in C using
 inline asm

* 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?

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.