xous-core/kernel/src
Sean Cross 5dfad296ae xous: mark MemoryRange::as_slice and friends as unsafe
Mark `MemoryRange::as_slice()` and `MemoryRange::as_slice_mut()` as
unsafe.

This is due to the fact that not all representable types can be cast to
an arbitrary value. For example, if Process A sends random values to
Process B, then Process B casts the memory to a slice of `bool`, then
any values that are not 0 or 1 are undefined.

Because these functions can leak UB into the program, they are marked as
unsafe.

This patch adds `unsafe {}` blocks to all instances where this function
is called. Additionally, all instances have been checked to verify that
they do not cast to any invalid types -- most use `u8` or `u32`.

Additionally, the long-deprecated `MemoryRange::from_parts()` call was
removed, since that causes UB without being marked as unsafe.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-09-12 10:07:38 +08:00
..
arch fix renode build 2023-07-18 13:58:14 +08:00
debug kernel: gdb: batch 2- and 4-byte accesses 2023-05-11 15:13:03 +08:00
platform kernel integrations for cramium 2023-07-17 18:49:21 +08:00
args.rs
asm.S kernel: fix atomic operations 2023-02-02 23:10:12 +08:00
io.rs kernel: Split debug shell and uart driver. 2022-11-02 14:30:31 +01:00
irq.rs kernel: make disable_irq() infallible 2023-04-06 10:42:46 +08:00
macros.rs
main.rs kernel: fix compile errors 2023-03-14 18:48:15 +04:00
mem.rs kernel: add sama5d2 uart workaround 2023-03-14 18:36:41 +04:00
server.rs kernel: server: check buf is some when returning mem 2022-12-29 21:03:39 +08:00
services.rs xous: mark MemoryRange::as_slice and friends as unsafe 2023-09-12 10:07:38 +08:00
syscall.rs Add virt_to_phys_pid syscall 2023-05-23 19:43:53 +04:00
test.rs try to fix the CI test routine 2022-01-10 19:03:20 +08:00