as_mut_fam_struct()
public and unsafe to let users modify fields of the header other than the length.serde
implementation of FamStructWrapper
which allowed out of bounds memory access from Rust-safe code. See the related GHSA here: https://github.com/rust-vmm/vmm-sys-util/security/advisories/GHSA-875g-mfp6-g7f9 for more information.SyscallReturnCode
to accept any signed integer type.rand_bytes
that was triggering a panic when the number of bytes was not a multiple of 4.TempFile::new_with_prefix()
on linux to use mkstemp
to prevent name collisions.rand_bytes
function that generates a pseudo random vector of len
bytes.std::error::Error
for fam::Error
.Eq
and PartialEq
for error types.xor_psuedo_rng_u32
to xor_pseudo_rng_u32
to fix a typo.xor_psuedo_rng_u8_alphanumerics
to xor_pseudo_rng_u8_alphanumerics
to fix a typo.Debug
for FamStructWrapper
& EventFd
.ioctl_expr
is now a const function instead of a macro.write_zeroes
to use FALLOC_FL_ZERO_RANGE
instead of FALLOC_FL_PUNCH_HOLE
.write_all_zeroes
to WriteZeroes
, which calls write_zeroes
in a loop until the requested length is met.WriteZeroesAt
, which allows giving the offset in file instead of using the current cursor.max_events
from Epoll::wait
which removes possible undefined behavior.PartialEq
implementation.Clone
implementation.metric
module that provides a Metric
interface as well as a default implementation for AtomicU64
.From<io::Error>
for errno::Error
.Epoll::ctl
signature such that EpollEvent
is passed by value and not by reference.serde
compatibility to FamStructWrapper
, gated by the with-serde
feature.Into<std::io::Error
for errno::Error
.libc::epoll
used for basic epoll operations.into_file
for TempFile which enables the TempFile to be used as a regular file.register_signal_handler
by allowing only valid signal numbers.for_vcpu
argument from signal::register_signal_handler
and signal::validate_signal_num
. Users can now pass absolute values for all valid signal numbers.flag
argument of signal::register_signal_handler
public methods, which now defaults to libc::SA_SIGINFO
.TempFile::new
and TempDir::new
to create new temporary files/ directories inside $TMPDIR
if set, otherwise inside /tmp
.This is the first vmm-sys-util crate release.
It is a collection of modules implementing helpers and utilities used by multiple rust-vmm components and rust-vmm based VMMs. Most of the code in this first release is based on either the crosvm or the Firecracker projects, or both.
The first release comes with the following Rust modules:
aio: Safe wrapper over Linux AIO
.
errno: Structures, helpers, and type definitions for working with errno
.
eventfd: Structure and wrapper functions for working with eventfd
.
fallocate: Enum and function for dealing with an allocated disk space by fallocate
.
fam: Trait and wrapper for working with C defined FAM structures.
file_traits: Traits for handling file synchronization and length.
ioctls: Macros and functions for working with ioctl
.
poll: Traits and structures for working with epoll
rand: Miscellaneous functions related to getting (pseudo) random numbers and strings.
seek_hole: Traits and implementations over lseek64
.
signal: Enums, traits and functions for working with signal
.
sockctrl_msg: Wrapper for sending and receiving messages with file descriptors on sockets that accept control messages (e.g. Unix domain sockets).
tempdir: Structure for handling temporary directories.
tempfile: Struct for handling temporary files as well as any cleanup required.
terminal: Trait for working with termios
.
timerfd: Structure and functions for working with timerfd
.
write_zeroes: Traits for replacing a range with a hole and writing zeroes in a file.