From d44a00853f501db00c2c9e47b8c770b892d57721 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Tue, 23 Jul 2024 11:32:12 +0200 Subject: executor: arm64: add syzos header For KVM fuzzing we are going to need some library code that will be running inside KVM to perform common tasks (e.g. register accesses, device setup etc.) This code will reside in a special ".guest" section that the executor will map at address 0xeeee8000. For now it contains just the main function, but will be extended in further patches. --- executor/common_kvm_arm64_syzos.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 executor/common_kvm_arm64_syzos.h (limited to 'executor/common_kvm_arm64_syzos.h') diff --git a/executor/common_kvm_arm64_syzos.h b/executor/common_kvm_arm64_syzos.h new file mode 100644 index 000000000..b9edf0069 --- /dev/null +++ b/executor/common_kvm_arm64_syzos.h @@ -0,0 +1,20 @@ +// Copyright 2024 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +// This file provides guest code running inside the ARM64 KVM. + +#include "kvm.h" + +// Host will map the code in this section into the guest address space. +#define GUEST_CODE __attribute__((section("guest"))) + +// Start/end of the guest section. +extern char *__start_guest, *__stop_guest; + +// Main guest function that performs necessary setup and passes the control to the user-provided +// payload. +GUEST_CODE static void guest_main() +{ + void (*guest_payload)() = (void (*)())ARM64_ADDR_USER_CODE; + guest_payload(); +} -- cgit mrf-deployment