From 2e16ac1977e641846ba0ef0cc7558a5e9a1ea946 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Wed, 23 Jul 2025 16:50:59 +0200 Subject: sys/linux: executor: implement SYZOS_API_WR_CRN on x86 Add a SYZOS call to write to one of the system registers (CR0, CR2, CR3, CR4, CR8). --- sys/linux/dev_kvm_amd64.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sys') diff --git a/sys/linux/dev_kvm_amd64.txt b/sys/linux/dev_kvm_amd64.txt index 0585a2d57..14c27edd1 100644 --- a/sys/linux/dev_kvm_amd64.txt +++ b/sys/linux/dev_kvm_amd64.txt @@ -59,12 +59,21 @@ syzos_api_rdmsr { arg_reg flags[msr_index, int64] } +# CR1 and CR5-7 are reserved. +x86_cr_reg_ids = 0, 2, 3, 4, 8 + +syzos_api_wr_crn { + arg_reg flags[x86_cr_reg_ids, int64] + arg_value int64 +} + syzos_api_call$x86 [ uexit syzos_api$x86[0, intptr] code syzos_api$x86[10, syzos_api_code$x86] cpuid syzos_api$x86[20, syzos_api_cpuid] wrmsr syzos_api$x86[30, syzos_api_wrmsr] rdmsr syzos_api$x86[50, syzos_api_rdmsr] + wr_crn syzos_api$x86[70, syzos_api_wr_crn] ] [varlen] kvm_text_x86 [ -- cgit mrf-deployment