mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 02:25:23 +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>
26 lines
643 B
TOML
26 lines
643 B
TOML
[package]
|
|
name = "x86_64"
|
|
version = "0.1.0"
|
|
authors = ["The Chromium OS Authors"]
|
|
edition = "2018"
|
|
build = "build.rs"
|
|
|
|
[dependencies]
|
|
arch = { path = "../arch" }
|
|
assertions = { path = "../assertions" }
|
|
byteorder = "*"
|
|
data_model = { path = "../data_model" }
|
|
devices = { path = "../devices" }
|
|
io_jail = { path = "../io_jail" }
|
|
kernel_cmdline = { path = "../kernel_cmdline" }
|
|
kernel_loader = { path = "../kernel_loader" }
|
|
kvm = { path = "../kvm" }
|
|
kvm_sys = { path = "../kvm_sys" }
|
|
libc = "*"
|
|
remain = "*"
|
|
resources = { path = "../resources" }
|
|
sync = { path = "../sync" }
|
|
sys_util = { path = "../sys_util" }
|
|
|
|
[build-dependencies]
|
|
cc = "=1.0.25"
|