Skip to content

Conversation

@newpavlov
Copy link
Member

@newpavlov newpavlov commented Jan 7, 2026

Adds a simple optimization_barrier-based function for stack zeroization. It requires an explicitly provided size since erasing the whole stack (2-8 MiB) can be expensive and it would be an overkill in most cases. Additionally, detection of remaining stack size (e.g. using pthread_attr_getstack) is platform-dependent and not available on all targets.

Closes #810

@newpavlov newpavlov requested a review from tarcieri January 7, 2026 20:13
@newpavlov newpavlov mentioned this pull request Jan 7, 2026
@newpavlov
Copy link
Member Author

Here you can see the function in action: https://rust.godbolt.org/z/Yd9hce7Yq

@newpavlov newpavlov merged commit 9e555db into master Jan 7, 2026
26 checks passed
@newpavlov newpavlov deleted the zeroize/stack branch January 7, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zeroize: stack zeroization support

3 participants