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:...@@ -16,8 +16,9 @@ __clone:
1616
17# store non-volatile regs r30, r31 on stack in order to put our17# store non-volatile regs r30, r31 on stack in order to put our
18# start func and its arg there18# start func and its arg there
19stwu 30, -16(1)19stwu 1, -16(1)
20stw 31, 4(1)20stw 30, 8(1)
21stw 31, 12(1)
2122
22# save r3 (func) into r30, and r6(arg) into r3123# save r3 (func) into r30, and r6(arg) into r31
23mr 30, 324mr 30, 3
...@@ -51,8 +52,8 @@ cmpwi cr7, 3, 0...@@ -51,8 +52,8 @@ cmpwi cr7, 3, 0
51# if not 0, restore stack and return52# if not 0, restore stack and return
52beq cr7, 2f53beq cr7, 2f
5354
54lwz 30, 0(1)55lwz 30, 8(1)
55lwz 31, 4(1)56lwz 31, 12(1)
56addi 1, 1, 1657addi 1, 1, 16
5758
58blr59blr