From b11fe40240f9b0ea84625da607041cf244052d3d Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 9 Jul 2021 01:08:16 +0200 Subject: [PATCH] LibELF: Make sure calls to _fixup_plt_entry use a properly aligned stack --- Userland/Libraries/LibELF/Arch/x86_64/plt_trampoline.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibELF/Arch/x86_64/plt_trampoline.S b/Userland/Libraries/LibELF/Arch/x86_64/plt_trampoline.S index 5d3c12b184..6af4407156 100644 --- a/Userland/Libraries/LibELF/Arch/x86_64/plt_trampoline.S +++ b/Userland/Libraries/LibELF/Arch/x86_64/plt_trampoline.S @@ -28,7 +28,12 @@ _plt_trampoline: # (object, relocation_index) shlq $3, %rsi leaq (%rsi, %rsi, 2), %rsi + pushq %rbp + movq %rsp, %rbp + andq $~15, %rsp call _fixup_plt_entry@PLT + movq %rbp, %rsp + popq %rbp movq %rax, 88(%rsp) # replace object argument with symbol address