News for hackers. Stuff that matters.
Re:A pair of Linux kernel modules using Rust by dcomp on Tuesday September 13, 2022 @06:54AM (#32822673)
From what I understand a rust panic will just call BUG(). There is no support for unwinding as such.

Most likely you would have to use .get() which returns an Option rather than [] array index which panics.

Re:A pair of Linux kernel modules using Rust by ogoffart on Tuesday September 13, 2022 @07:31AM (#32822947)
Exactly. A rust panic will call the panic_handler, implemented there: https://github.com/Rust-for-Linux/linux/blob/459035ab65c0ebb...

So accessing an array out of bound will have a runtime check that will call the panic handler, and that panic handler calls BUG() which means kernel panic.