From 3dfced0c70773d7544132b47a2766fddc4a6ff48 Mon Sep 17 00:00:00 2001 From: Marios Pomonis Date: Mon, 31 Mar 2025 00:16:52 -0700 Subject: executor/kvm: set up X86-64 SYZOS This commit prepares adding the X86-64 SYZOS by declaring the relevant functions, updating their ARM64 versions and adding placeholders. --- sys/linux/dev_kvm_amd64.txt | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 sys/linux/dev_kvm_amd64.txt (limited to 'sys/linux/dev_kvm_amd64.txt') diff --git a/sys/linux/dev_kvm_amd64.txt b/sys/linux/dev_kvm_amd64.txt new file mode 100644 index 000000000..8c791c65d --- /dev/null +++ b/sys/linux/dev_kvm_amd64.txt @@ -0,0 +1,40 @@ +# 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. + +# x86(-64)-specific KVM syscall declarations. + +meta arches["386", "amd64"] + +include +include + +# kvm_syz_vm is a VM handler used by syzos-related pseudo-syscalls. It is actually an opaque pointer under the hood. +resource kvm_syz_vm$x86[int64] + +# Map the given memory into the VM and set up syzos there. +syz_kvm_setup_syzos_vm$x86(fd fd_kvmvm, usermem vma[1024]) kvm_syz_vm$x86 + +# Create a VCPU inside a kvm_syz_vm VM. +syz_kvm_add_vcpu$x86(vm kvm_syz_vm$x86, text ptr[in, kvm_text$x86]) fd_kvmcpu + +kvm_text$x86 { + typ const[0, intptr] + text ptr[in, array[syzos_api_call$x86, 1:32]] + size bytesize[text, int64] +} + +syzos_api_code$x86 { + insns text[x86_64] + ret const[0xc3, int8] +} [packed] + +type syzos_api$x86[NUM, PAYLOAD] { + call const[NUM, int64] + size bytesize[parent, int64] + payload PAYLOAD +} + +syzos_api_call$x86 [ + uexit syzos_api$x86[0, intptr] + code syzos_api$x86[1, syzos_api_code$x86] +] [varlen] -- cgit mrf-deployment