-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
bugSomething isn't workingSomething isn't working
Description
In both the x86 and riscv64 implementations the constructors are not marked as unsafe despite taking an arbitrary port address and later writing to it. A user of the crate could incredibly easily cause an illegal write by passing an invalid address.
x86
Line 36 in d157a2a
| pub const fn new(io_base: u16, custom_exit_success: u32) -> Self { |
Lines 25 to 30 in d157a2a
| asm!( | |
| "out dx, eax", | |
| in("dx") io_base, | |
| in("eax") code, | |
| options(nomem, nostack) | |
| ); |
riscv64
Line 29 in d157a2a
| pub const fn new(addr: u64) -> Self { |
Lines 44 to 47 in d157a2a
| asm!( | |
| "sw {0}, 0({1})", | |
| in(reg)code_new, in(reg)self.addr | |
| ); |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working