[Feature request] Heap canary
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- rust
- Domain
- operating-systems
Research direction
Start by reading the allocator's hole.rs around the reported overflow at line 311 and trace how Hole structures are created, modified, and checked. Define how optional magic-byte checks, corrupted addresses in panic messages, and whole-heap verification would integrate without production overhead. Done means the design and implementation cover these checks with a way to disable them.
Written by the indexing model from the issue text.
Description
Recently I occurred a heap corruption bug in one of my real life projects:
Kernel panic - aborting: at /home/kazurin/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/linked_list_allocator-0.9.1/src/hole.rs:311: attempt to add with overflow
It took me long before I was able to discover the root cause, due to the complication of kernel debugging and the need to read the source code of various crates. It might be handy to have some simple heap canary mechanism (just like what Valgrind does) built into the allocator in such cases.
Features that I consider useful:
- Ability to detect the corruption of heap control structures (namely the
Holes) using some predefined magic bytes in the structure - Ability to reveal the corrupted structure's address in the panic message (for easier debugging)
- Ability to verify the integrity of the whole heap at any time
- The heap canary feature should be completely optional, in order not to cause preformance impact on production code
If such features are acceptable but not planned, perhaps I could do a PR in the future :)
- Dominant language
- Rust
- Stars
- 242
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-osdev/linked-list-allocator
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-osdev/linked-list-allocator#86 · 3 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
help wanted
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-osdev/linked-list-allocator#83 · 2 comments ·
All issues in rust-osdev/linked-list-allocator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100