From f988949d7e57f005fba0dbc14491ed9b065c2e36 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Tue, 27 Aug 2024 00:19:53 -0500 Subject: [boards/qemu-virt] Adds a canary for stack overflow. --- boards/qemu-virt/qemu-virt.s | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'boards/qemu-virt/qemu-virt.s') diff --git a/boards/qemu-virt/qemu-virt.s b/boards/qemu-virt/qemu-virt.s index b9544be..c7e7642 100644 --- a/boards/qemu-virt/qemu-virt.s +++ b/boards/qemu-virt/qemu-virt.s @@ -19,6 +19,11 @@ _start: ## Set up hart0's stack. la sp, hart0_initial_stack_top + ## Write a canary to hart0's stack. + li t0, 0xdead0bad0defaced + la t1, hart0_initial_stack + sd t0, (t1) + ## Put the address of the DeviceTree into the first argument position ## for hart0_boot. c.mv a0, a1 -- cgit v1.2.3