Skip to content

Ignore munlock failures #2804

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

Merged
merged 2 commits into from
May 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions utils/s2n_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,9 @@ static int s2n_mem_cleanup_impl(void)

static int s2n_mem_free_mlock_impl(void *ptr, uint32_t size)
{
int munlock_rc = munlock(ptr, size);
/* Perform a best-effort `munlock`: ignore any errors during unlocking. */
munlock(ptr, size);
free(ptr);
POSIX_ENSURE(munlock_rc == 0, S2N_ERR_MUNLOCK);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we also remove S2N_ERR_MUNLOCK from s2n_errno.c since this doesnt exist anymore?

Copy link
Contributor

@toidiu toidiu May 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking about this more, removing S2N_ERR_MUNLOCK might be a breaking api change so possibly no good


return S2N_SUCCESS;
}

Expand Down