forked from OpenSC/OpenSC
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allocate whole page(s) for each sc_mem_secure_alloc
sc_mem_secure_alloc uses calloc to allocate memory, but then uses mlock to try to lock the allocated memory. calloc may not necessarily return a page-aligned pointer, even if we request a whole page of memory. Instead we use aligned_alloc to ensure we get whole page(s) to ourselves for sc_mem_secure_alloc. Fixes OpenSC#3267 Thanks to Davis Gallinghouse @dgalling
- Loading branch information
1 parent
7f7e5dd
commit f3659dd
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters