Skip to main content


In #Rust, it is undefined behavior to read uninitialized memory.

It is possible to write an operating system kernel in Rust.

An operating system kernel must, at times, read arbitrary memory belonging to a process. The POSIX `write` function, for example.

That memory might be uninitialized. For security reasons, UB must not propagate to other processes as a result of reading it, and yet that appears unavoidable.

How is a kernel written in Rust supposed to deal with this?

#programming