authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 03:04:24+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-09 17:53:03+02:00
log89f6d00cad6bd833f8a14baa03c844a531e61d31
tree47391c9184d3796c87d0652644afb793c716c105
parentd8426e69c34768fda27c47078aafdec1f20f020b
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

musl: set up a proper stack frame in the parent thread in powerpc clone()

https://www.openwall.com/lists/musl/2026/08/09/1

1 files changed, 5 insertions(+), 4 deletions(-)

lib/libc/musl/src/thread/powerpc/clone.s+5-4
......@@ -16,8 +16,9 @@ __clone:
1616
1717# store non-volatile regs r30, r31 on stack in order to put our
1818# start func and its arg there
19stwu 30, -16(1)
20stw 31, 4(1)
19stwu 1, -16(1)
20stw 30, 8(1)
21stw 31, 12(1)
2122
2223# save r3 (func) into r30, and r6(arg) into r31
2324mr 30, 3
......@@ -51,8 +52,8 @@ cmpwi cr7, 3, 0
5152# if not 0, restore stack and return
5253beq cr7, 2f
5354
54lwz 30, 0(1)
55lwz 31, 4(1)
55lwz 30, 8(1)
56lwz 31, 12(1)
5657addi 1, 1, 16
5758
5859blr