# A better Windows kernel Rust bug

**URL:** <https://users.rust-lang.org/t/a-better-windows-kernel-rust-bug/134844>\
**Category:** uncategorized\
**Created:** [October 21, 2025, 9:15pm UTC](https://users.rust-lang.org/t/a-better-windows-kernel-rust-bug/134844 "2025-10-21T21:15:25Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Evian-Zhang](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/evian-zhang/32/15556_2.png) [@Evian-Zhang](https://users.rust-lang.org/u/Evian-Zhang)\
**Post date:** [October 22, 2025, 7:42am UTC](https://users.rust-lang.org/t/a-better-windows-kernel-rust-bug/134844/12 "2025-10-22T07:42:26Z")

</div>

> their belief that Rust out of bounds errors shouldn't bring down the system

I have seen many cases where people got surprised that Rust program's unexpected behaviors. I think we should add more explanation of these two very important chapters [Behavior considered undefined](https://doc.rust-lang.org/reference/behavior-considered-undefined.html) and [Behavior not considered `unsafe`](https://doc.rust-lang.org/reference/behavior-not-considered-unsafe.html) in The Rust Reference, mapping those low-level details to high-level vulnerability descriptions that normal people can understand.

For example:

(all below are discussed in safe Rust context)

- Rust program may abort and unwind
- Rust program may contain RCE vulnerabilities caused by logic error
  - For example, command injection if the developer simply concat commands and throw it to `/bin/sh` to execute
  - For example, developers use arena to simulate a "heap", and use index to simulate the address. Then some wrong logic may lead to situations like heap overflow, double free or use-after-free.

- Rust program can never contain RCE vulnerabilities caused by control-flow-hijack
  - For example, stack overflow to overwrite return address, or heap overflow to overwrite some function pointers.

---

_[View the full topic](https://users.rust-lang.org/t/a-better-windows-kernel-rust-bug/134844)._
