From 89f6d00cad6bd833f8a14baa03c844a531e61d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 9 Aug 2026 03:04:24 +0200 Subject: [PATCH] musl: set up a proper stack frame in the parent thread in powerpc clone() https://www.openwall.com/lists/musl/2026/08/09/1 --- lib/libc/musl/src/thread/powerpc/clone.s | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libc/musl/src/thread/powerpc/clone.s b/lib/libc/musl/src/thread/powerpc/clone.s index 019fd62a95afc6e4cff64f0c5bce1e1d41ae33c8..29c0b2ef4e34a2b0ed04c42e6a43d1deddbb4d13 100644 --- a/lib/libc/musl/src/thread/powerpc/clone.s +++ b/lib/libc/musl/src/thread/powerpc/clone.s @@ -16,8 +16,9 @@ __clone: # store non-volatile regs r30, r31 on stack in order to put our # start func and its arg there -stwu 30, -16(1) -stw 31, 4(1) +stwu 1, -16(1) +stw 30, 8(1) +stw 31, 12(1) # save r3 (func) into r30, and r6(arg) into r31 mr 30, 3 @@ -51,8 +52,8 @@ cmpwi cr7, 3, 0 # if not 0, restore stack and return beq cr7, 2f -lwz 30, 0(1) -lwz 31, 4(1) +lwz 30, 8(1) +lwz 31, 12(1) addi 1, 1, 16 blr -- 2.54.0