crosvm/x86_64/src
Dylan Reid 0584fe9fb2 Limit types that can be read from guest memory
Not all types are safe to read from guest memory.  Any type with a
reference or pointer will be initialized to random bits that don't refer
to a valid address.  This can cause dangling pointer and general
unsafe behavior.

To fix this, limit types that can be read with read_obj to those that
implement the unsafe trait `DataInit`.  Provide implementations of
`DataInit` for intrinsic types that are obviously safe to initialize
with random data.

Implement the needed traits for bootparam types as they are read from
the kernel image directly.

Change-Id: I1040f5bc1b2fc4c58c87d8a2ce3f618edcf6f9b1
Signed-off-by: Dylan Reid <dgreid@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/540750
Reviewed-by: Zach Reizner <zachr@chromium.org>
2017-06-27 00:20:33 -07:00
..
bootparam.rs
cpuid.rs x86_64: Remove extra closure args and double-derefs 2017-05-29 21:49:05 -07:00
gdt.rs
interrupts.rs x86_64: Remove extra closure args and double-derefs 2017-05-29 21:49:05 -07:00
lib.rs Limit types that can be read from guest memory 2017-06-27 00:20:33 -07:00
mpspec.rs x86_64: add multi-cpu setup support 2017-05-25 22:51:15 -07:00
mptable.rs x86_64: add multi-cpu setup support 2017-05-25 22:51:15 -07:00
msr_index.rs
regs.rs x86_64: Remove extra closure args and double-derefs 2017-05-29 21:49:05 -07:00