Open
Description
Hello, thank you for your contribution in this project. I am scanning unsound problem in rust project and I notice the following code:
aero/src/aero_kernel/src/acpi/rsdp.rs
Line 94 in c5f8114
pub fn new(address: VirtAddr) -> &'static Self {
let this = unsafe { &*address.as_ptr::<Self>() };
let valid_checksum = this.header.is_valid();
let valid_signature = this.header.signature() == b"RSDT";
assert!(valid_checksum, "rsdp: failed to validate RSDT checksum");
assert!(valid_signature, "rsdp: failed to validate RSDT signature");
this
}
Considering this is a pub function and there is no varify in VirtAddr
contruct method, I think this is unsound because the address can be any invalid value and deference it will result in UB.
Metadata
Metadata
Assignees
Labels
No labels