Public Slice bookkeeping allows callers to free live pool memory

Open Beginner friendly
#2,275 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
rust
Domain
security

Research direction

Locate the definitions of Slice, its index and shared_state fields, and SharedState::toogle. Read their usages to confirm which bookkeeping access must no longer be public and check that callers cannot mark a slot free while a Slice remains alive. Done means the unsafe public access is removed without breaking the intended pool behavior.

Written by the indexing model from the issue text.

Description

Slice exposes index and shared_state, while SharedState::toogle is also public. This allows safe callers to mark a slot as free while its Slice is still alive.

The pool can then reuse the underlying memory, causing the live slice to overlap another allocation and allowing data corruption or disclosure.

These bookkeeping fields and toogle should not be publicly accessible.

Dominant language
Rust
Stars
352
Forks
200
Avg merge
4d 17h
Merged PRs (30d)
12

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stratum-mining/stratum

All issues in stratum-mining/stratum

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.