lockedpool: When possible, use madvise to avoid including sensitive information in core dumps
This commit is contained in:
parent
4277ef2063
commit
6b278b20cb
|
@ -257,6 +257,9 @@ void *PosixLockedPageAllocator::AllocateLocked(size_t len, bool *lockingSuccess)
|
||||||
}
|
}
|
||||||
if (addr) {
|
if (addr) {
|
||||||
*lockingSuccess = mlock(addr, len) == 0;
|
*lockingSuccess = mlock(addr, len) == 0;
|
||||||
|
#ifdef MADV_DONTDUMP
|
||||||
|
madvise(addr, len, MADV_DONTDUMP);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue