Skip to content

Commit 836cb91

Browse files
committed
fix(kvm): copy IO data before calling handle_pv_timer_config
The data slice borrows from the KVM run buffer (self.vcpu_fd), so calling self.handle_pv_timer_config(data) would create a conflicting mutable borrow. Copy data to a local Vec before calling the method. Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent a834801 commit 836cb91

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/hyperlight_host/src/hypervisor/virtual_machine/kvm

src/hyperlight_host/src/hypervisor/virtual_machine/kvm/x86_64.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ impl KvmVm {
220220
return Ok(VmExit::Halt());
221221
}
222222
if port == VmAction::PvTimerConfig as u16 {
223-
self.handle_pv_timer_config(data);
223+
let data_copy = data.to_vec();
224+
self.handle_pv_timer_config(&data_copy);
224225
continue;
225226
}
226227
// PIT ports (0x40-0x43): no in-kernel PIT, so these

0 commit comments

Comments
 (0)