From ed18d86f082bc91e1f1d58bef666ec34d9ee4422 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 7 Mar 2023 18:47:13 +0200 Subject: [PATCH] Kernel: Fix spinlock unlocking in x86_64 Spinlock unlock used a 64 bit write on 32 bit integer, overwriting some random memory. This caused some really hard to find bugs --- kernel/arch/x86_64/SpinLock.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/arch/x86_64/SpinLock.S b/kernel/arch/x86_64/SpinLock.S index 4ab72a3dd3..ad27179bc8 100644 --- a/kernel/arch/x86_64/SpinLock.S +++ b/kernel/arch/x86_64/SpinLock.S @@ -13,5 +13,5 @@ spinlock_lock_asm: .global spinlock_unlock_asm spinlock_unlock_asm: - movq $0, (%rdi) + movl $0, (%rdi) ret \ No newline at end of file