mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 20:48:55 +00:00
4b292afafc
This CL fixes four cases of what I believe are undefined behavior: - In vhost where the original code allocates a Vec<u8> with 1-byte alignment and casts the Vec's data pointer to a &mut vhost_memory which is required to be 8-byte aligned. Underaligned references of type &T or &mut T are always undefined behavior in Rust. - Same pattern in x86_64. - Same pattern in plugin::vcpu. - Code in crosvm_plugin that dereferences a potentially underaligned pointer. This is always undefined behavior in Rust. TEST=bin/clippy TEST=cargo test sys_util Change-Id: I926f17b1fe022a798f69d738f9990d548f40c59b Reviewed-on: https://chromium-review.googlesource.com/1566736 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: David Tolnay <dtolnay@chromium.org>
83 lines
2.3 KiB
TOML
83 lines
2.3 KiB
TOML
[package]
|
|
name = "crosvm"
|
|
version = "0.1.0"
|
|
authors = ["The Chromium OS Authors"]
|
|
edition = "2018"
|
|
|
|
[profile.release]
|
|
panic = 'abort'
|
|
overflow-checks = true
|
|
|
|
[workspace]
|
|
members = ["qcow_utils"]
|
|
exclude = [
|
|
"assertions",
|
|
"data_model",
|
|
"rand_ish",
|
|
"sync",
|
|
"sys_util",
|
|
"syscall_defines",
|
|
"tempfile",
|
|
]
|
|
|
|
[features]
|
|
default-no-sandbox = []
|
|
gpu = ["devices/gpu"]
|
|
gpu-forward = ["render_node_forward"]
|
|
plugin = ["protos/plugin", "crosvm_plugin", "protobuf"]
|
|
sandboxed-libusb = ["devices/sandboxed-libusb", "vm_control/sandboxed-libusb"]
|
|
tpm = ["devices/tpm"]
|
|
wl-dmabuf = ["devices/wl-dmabuf", "gpu_buffer", "resources/wl-dmabuf"]
|
|
|
|
[dependencies]
|
|
arch = { path = "arch" }
|
|
assertions = { path = "assertions" }
|
|
audio_streams = "*"
|
|
bit_field = { path = "bit_field" }
|
|
byteorder = "=1.1.0"
|
|
crosvm_plugin = { path = "crosvm_plugin", optional = true }
|
|
data_model = "*"
|
|
devices = { path = "devices" }
|
|
enumn = { path = "enumn" }
|
|
gpu_buffer = { path = "gpu_buffer", optional = true }
|
|
io_jail = { path = "io_jail" }
|
|
kernel_cmdline = { path = "kernel_cmdline" }
|
|
kernel_loader = { path = "kernel_loader" }
|
|
kvm = { path = "kvm" }
|
|
kvm_sys = { path = "kvm_sys" }
|
|
libc = "=0.2.44"
|
|
libcras = "*"
|
|
msg_socket = { path = "msg_socket" }
|
|
net_util = { path = "net_util" }
|
|
p9 = { path = "p9" }
|
|
protobuf = { version = "2.3", optional = true }
|
|
protos = { path = "protos", optional = true }
|
|
qcow = { path = "qcow" }
|
|
rand_ish = { path = "rand_ish" }
|
|
remain = "*"
|
|
render_node_forward = { path = "render_node_forward", optional = true }
|
|
resources = { path = "resources" }
|
|
sync = { path = "sync" }
|
|
sys_util = "*"
|
|
vhost = { path = "vhost" }
|
|
vm_control = { path = "vm_control" }
|
|
|
|
[target.'cfg(target_arch = "x86_64")'.dependencies]
|
|
x86_64 = { path = "x86_64" }
|
|
|
|
[target.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'.dependencies]
|
|
aarch64 = { path = "aarch64" }
|
|
|
|
[dev-dependencies]
|
|
sys_util = "*"
|
|
|
|
[patch.crates-io]
|
|
assertions = { path = "assertions" }
|
|
audio_streams = { path = "../../third_party/adhd/audio_streams" } # ignored by ebuild
|
|
data_model = { path = "data_model" }
|
|
libcras = { path = "../../third_party/adhd/cras/client/libcras" } # ignored by ebuild
|
|
poll_token_derive = { path = "sys_util/poll_token_derive" }
|
|
sync = { path = "sync" }
|
|
sys_util = { path = "sys_util" }
|
|
syscall_defines = { path = "syscall_defines" }
|
|
tempfile = { path = "tempfile" }
|