A first look at Rust in the 6.1 kernel
A first look at Rust in the 6.1 kernel
Posted Oct 14, 2022 4:21 UTC (Fri) by rsidd (subscriber, #2582)In reply to: A first look at Rust in the 6.1 kernel by quotemstr
Parent article: A first look at Rust in the 6.1 kernel
Posted Oct 14, 2022 16:58 UTC (Fri)
by NYKevin (subscriber, #129325)
[Link] (2 responses)
Posted Oct 14, 2022 18:49 UTC (Fri)
by NYKevin (subscriber, #129325)
[Link]
(Or, more prosaically, someone has violated the safety rules in an unsafe block or in native C code or something along those lines. "Unsafe" doesn't mean "I can do whatever I want," it means "the compiler isn't checking everything here, so I have to be careful.")
Posted Oct 14, 2022 23:41 UTC (Fri)
by tialaramex (subscriber, #21167)
[Link]
So logically this code happens because the kernel is destroying this value, if Linux actually keeps the value alive that's a kernel bug, it's logically OK if the kernel can't or won't clean up the RAM used for the module, but it definitely can't expect that the Vec still works for example since Rust will have recursively called Drop::drop on the Vec inside this type (and so on) and the Vec is presumably delegating to some kernel allocator to get suitable blocks of memory which it will then give back when destroyed.
A first look at Rust in the 6.1 kernel
A first look at Rust in the 6.1 kernel
A first look at Rust in the 6.1 kernel