Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add munlock to s2n_free #195

Merged
merged 2 commits into from
Mar 1, 2016
Merged

Add munlock to s2n_free #195

merged 2 commits into from
Mar 1, 2016

Conversation

raycoll
Copy link
Contributor

@raycoll raycoll commented Feb 22, 2016

Previously, pages for freed blobs would remain locked in resident memory even
after calling s2n_free. According to http://linux.die.net/man/2/munlock:
these pages would stay locked until the process exits.

The mlocked bit field is added to help track which s2n_blobs need to be
munlock'd when freed. Currently any successfully allocated blob
will have mlocked == 1.

Decided to do this in a separate PR than #194 because it might need some work.

Previously, pages for freed blobs would remain locked in resident memory even
after calling s2n_free. According to http://linux.die.net/man/2/munlock:
these pages would stay locked until the process exits.

The mlocked bit field is added to help track which s2n_blobs need to be
munlock'd when freed. Currently any *successfully* allocated blob
will have mlocked == 1.
Prevents a race condition where another party may allocate locked
memory. The logic here is convoluted because we still want to free
the blob on munlock failure
colmmacc added a commit that referenced this pull request Mar 1, 2016
@colmmacc colmmacc merged commit c7f3845 into aws:master Mar 1, 2016
@raycoll raycoll deleted the munlock branch December 7, 2016 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants