void * leak
pointer to the heap fragment we leaked before protecting the page
bool forbidPage(const T *addr)
forbid access to the page containing addr, setting its prot to PROT_NONE
protected_t::const_iterator const_iterator
PageAccessControl(size_t reservedSize=65535)
const protected_t & protectedPtrs() const
procmaps m_pmaps
the content of /proc/self/maps
bool forbidPage(const void *addr)
FIXME this will not work well for objects spanning across pages.
bool operator<(const PageAccessControl::Entry &lhs, const PageAccessControl::Entry &rhs)
const_iterator beginProtectedPtrs() const
std::vector< Entry > protected_t
the list of protected pages
PageAccessControl(procmaps &pmaps, size_t reservedSize=65535)
const void * addr
address of page for which protection was requested. Used as key
bool forbidPage(const void *addr, size_t objSize)
forbid access to the page containing addr, setting its prot to PROT_NONE
const_iterator endProtectedPtrs() const
size_t lenProt
length of the protected region, from page addr to end of protected obj
Entry(const void *a, size_t l, int p, void *pl)
bool protectPage(T *addr, int prot)
protect the page containing addr, record the amount of memory we protected NOTE To avoid SEGV,...