Skip to content

egg-secure-memory: Allocate enough space for the guard pointers

Simon McVittie requested to merge wip/smcv/allow-for-overhead into master
  • egg-secure-memory: Allocate enough space for the guard pointers

    Cell allocations have an overhead of two pointer-sized words, which we need to take into account. Otherwise, whenever we try to allocate a new block to hold at least DEFAULT_BLOCK_SIZE - 2 * sizeof (void *) bytes, it will end up too small to allocate a cell of that size and we will fall back to non-mlock'd memory with a warning.

    Fixes: 982aadd9 "Completely overhaul the secure memory allocator"
    Resolves: #36

  • egg-secure-memory: Add a warning if #36 happens again

    If we call sec_block_create() to allocate a block sized to hold length bytes, and we succeed, then we should really be able to sec_alloc() a cell of length bytes within that block. If we can't, then we chose the size of the block incorrectly.

Merge request reports