File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ license-file = "LICENSE"
88description = " A intel-focused hypervisor using VT-x/EPT"
99
1010[dependencies ]
11- multiboot2 = " 0.8.1 "
11+ multiboot2 = " 0.9.0 "
1212mythril_core = { version = " *" , path = " ../mythril_core" }
1313log = { version = " 0.4.8" , default-features = false }
1414linked_list_allocator = " 0.8.1"
Original file line number Diff line number Diff line change 1+ use alloc:: string:: ToString ;
12use multiboot2:: BootInformation ;
23use mythril_core:: acpi;
34use mythril_core:: error:: { Error , Result } ;
@@ -41,6 +42,11 @@ impl VmServices for Multiboot2Services {
4142 self . info . rsdp_v1_tag ( ) . map_or_else (
4243 || Err ( Error :: NotFound ) ,
4344 move |tag_v1| {
45+ if !tag_v1. checksum_is_valid ( ) {
46+ return Err ( Error :: InvalidValue (
47+ "Invalid RSDP V1 checksum" . to_string ( ) ,
48+ ) ) ;
49+ }
4450 let id = tag_v1. oem_id ( ) . unwrap_or ( " " ) . as_bytes ( ) ;
4551 arr. copy_from_slice ( & id[ 0 ..6 ] ) ;
4652 Ok ( acpi:: rsdp:: RSDP :: V1 {
@@ -51,6 +57,11 @@ impl VmServices for Multiboot2Services {
5157 )
5258 } ,
5359 move |tag_v2| {
60+ if !tag_v2. checksum_is_valid ( ) {
61+ return Err ( Error :: InvalidValue (
62+ "Invalid RSDP V2 checksum" . to_string ( ) ,
63+ ) ) ;
64+ }
5465 let id = tag_v2. oem_id ( ) . unwrap_or ( " " ) . as_bytes ( ) ;
5566 let mut arr: [ u8 ; 6 ] = [ 0 ; 6 ] ;
5667 arr. copy_from_slice ( & id[ 0 ..6 ] ) ;
You can’t perform that action at this time.
0 commit comments