Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## Upcoming Release

## v0.19.1

### Fixed

- [[#298](https://github.com/rust-vmm/kvm/pull/298)]: Fixed incorrect usage of `ioctl_wit_ref` in the
`create_device` method. Replace it with `ioctl_wit_mut_ref` as the passed parameter may be mutated by the
ioctl.

## v0.19.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kvm-ioctls"
version = "0.19.0"
version = "0.19.1"
authors = ["Amazon Firecracker Team <[email protected]>"]
description = "Safe wrappers over KVM ioctls"
repository = "https://github.com/rust-vmm/kvm-ioctls"
Expand Down
8 changes: 4 additions & 4 deletions src/ioctls/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ use crate::ioctls::{KvmRunWrapper, Result};
use crate::kvm_ioctls::*;
use vmm_sys_util::errno;
use vmm_sys_util::eventfd::EventFd;
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
use vmm_sys_util::ioctl::ioctl;
#[cfg(target_arch = "x86_64")]
use vmm_sys_util::ioctl::ioctl_with_mut_ptr;
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
use vmm_sys_util::ioctl::{ioctl, ioctl_with_mut_ref};
use vmm_sys_util::ioctl::{ioctl_with_ref, ioctl_with_val};
use vmm_sys_util::ioctl::{ioctl_with_mut_ref, ioctl_with_ref, ioctl_with_val};

/// An address either in programmable I/O space or in memory mapped I/O space.
///
Expand Down Expand Up @@ -1306,7 +1306,7 @@ impl VmFd {
/// ```
pub fn create_device(&self, device: &mut kvm_create_device) -> Result<DeviceFd> {
// SAFETY: Safe because we are calling this with the VM fd and we trust the kernel.
let ret = unsafe { ioctl_with_ref(self, KVM_CREATE_DEVICE(), device) };
let ret = unsafe { ioctl_with_mut_ref(self, KVM_CREATE_DEVICE(), device) };
if ret == 0 {
// SAFETY: We validated the return of the function creating the fd and we trust the
// kernel.
Expand Down