aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--executor/common_kvm_arm64.h4
-rw-r--r--pkg/csource/generated.go2
2 files changed, 4 insertions, 2 deletions
diff --git a/executor/common_kvm_arm64.h b/executor/common_kvm_arm64.h
index 201fa87e9..6369cdd81 100644
--- a/executor/common_kvm_arm64.h
+++ b/executor/common_kvm_arm64.h
@@ -66,8 +66,10 @@ static volatile long syz_kvm_setup_cpu(volatile long a0, volatile long a1, volat
}
struct kvm_vcpu_init init;
- ioctl(cpufd, KVM_ARM_PREFERRED_TARGET, &init);
+ // Queries KVM for preferred CPU target type.
+ ioctl(vmfd, KVM_ARM_PREFERRED_TARGET, &init);
init.features[0] = features;
+ // Use the modified struct kvm_vcpu_init to initialize the virtual CPU.
ioctl(cpufd, KVM_ARM_VCPU_INIT, &init);
if (text_size > 1000)
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index c983873c8..cf1a1383a 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -8173,7 +8173,7 @@ static volatile long syz_kvm_setup_cpu(volatile long a0, volatile long a1, volat
}
struct kvm_vcpu_init init;
- ioctl(cpufd, KVM_ARM_PREFERRED_TARGET, &init);
+ ioctl(vmfd, KVM_ARM_PREFERRED_TARGET, &init);
init.features[0] = features;
ioctl(cpufd, KVM_ARM_VCPU_INIT, &init);