crosvm/cros_fdt
Jakob Vukalovic 59e5ba50ea cros_fdt: Improve Fdt size checks
Calling Fdt::from_blob with a byte slice shorter than FDT header size
currently panics. This changes makes from_blob return an error instead.
It also ensures other sizes and offsets in the header make sense,
before continuing to parse other FDT structures.

Bug: b/296796644
Test: cd cros_fdt && cargo test
Change-Id: I37ae3cc360fd3cb88ed670320ab5536ac1bd9691
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5116143
Commit-Queue: Jakob Vukalović <jakobvukalovic@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2023-12-14 21:21:47 +00:00
..
src cros_fdt: Improve Fdt size checks 2023-12-14 21:21:47 +00:00
test-files cros_fdt: Implement overlay filtering 2023-11-10 09:38:05 +00:00
Cargo.toml Fix remaining Chrome/Chromium OS instances 2023-01-03 22:14:30 +00:00