From 2290cf73cce1292d9345a8183fd29ae3994a9481 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Netto Date: Thu, 12 Jan 2023 10:58:50 -0300 Subject: Linux: Do not align the stack for __clone3 All internal callers of __clone3 should provide an already aligned stack. Removing the stack alignment in __clone3 is a net gain: it simplifies the internal function contract (mask/unmask signals) along with the arch-specific code. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell --- include/clone_internal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/clone_internal.h b/include/clone_internal.h index 73b8114df4..f8198d8059 100644 --- a/include/clone_internal.h +++ b/include/clone_internal.h @@ -11,6 +11,9 @@ Different than kernel, the implementation also returns EINVAL for an invalid NULL __CL_ARGS or __FUNC (similar to __clone). + All callers are responsible for correctly aligning the stack. The stack is + not aligned prior to the syscall (this differs from the exported __clone). + This function is only implemented if the ABI defines HAVE_CLONE3_WRAPPER. */ extern int __clone3 (struct clone_args *__cl_args, size_t __size, -- cgit v1.2.3