Files
systemd/docs
Christian Brauner 8f9c69af31 rust: add an allocator that erases memory before freeing it
C code keeps secrets in buffers that it frees with erase_and_free().
That's a convention every caller has to remember. With the allocator
being part of the type Rust code can make it a guarantee instead.

Add Erasing which allocates like Malloc but frees memory with
erase_and_free(), which erases it first. It never uses realloc() as
that may leave the old contents behind in the memory it frees. Growing
allocates anew, copies and erases the old memory instead. So a buffer
holding a key or a passphrase is simply a Vec<u8, Erasing>.

Note that elements a Vec drops early via pop() or truncate() stay in
its memory until it is freed.

HACKING.md and CODING_STYLE.md point secrets at it.

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-10-23 16:34:47 +02:00
..
2026-01-31 01:11:11 +09:00
2026-04-14 17:32:37 +01:00
2025-11-12 23:01:35 +00:00
2026-01-31 01:11:11 +09:00
2026-03-24 17:55:26 +01:00
2026-10-03 16:12:54 +02:00
2026-01-31 01:11:11 +09:00
2026-01-31 01:11:11 +09:00
2026-01-31 01:11:11 +09:00
2026-10-05 09:35:58 +02:00
2026-01-31 01:11:11 +09:00
2025-05-14 18:06:04 +02:00
2026-01-31 01:11:11 +09:00
2026-10-05 09:35:58 +02:00
2026-01-31 01:11:11 +09:00
2026-01-31 01:11:11 +09:00
2026-01-31 01:11:11 +09:00
2024-03-15 04:04:01 +09:00
2026-09-22 18:46:41 +02:00