mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +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>
12 lines
277 B
TOML
12 lines
277 B
TOML
[package]
|
|
name = "vhost"
|
|
version = "0.1.0"
|
|
authors = ["The Chromium OS Authors"]
|
|
edition = "2018"
|
|
|
|
[dependencies]
|
|
assertions = { path = "../assertions" }
|
|
libc = "*"
|
|
net_util = { path = "../net_util" }
|
|
sys_util = { path = "../sys_util" }
|
|
virtio_sys = { path = "../virtio_sys" }
|