mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge #15600: lockedpool: When possible, use madvise to avoid including sensitive information in core dumps
d831831822
lockedpool: When possible, use madvise to avoid including sensitive information in core dumps (Luke Dashjr) Pull request description: If we're mlocking something, it's because it's sensitive information. Therefore, don't include it in core dump files, ~~and unmap it from forked processes~~. The return value is not checked because the madvise calls might fail on older kernels as a rule (unsure). ACKs for top commit: practicalswift: Code review ACKd831831822
-- patch looks correct laanwj: ACKd831831822
jonatack: ACKd831831822
vasild: ACKd831831822
Tree-SHA512: 9a6c1fef126a4bbee0698bfed5a01233460fbcc86380d984e80dfbdfbed3744fef74527a8e3439ea226167992cff9d3ffa8f2d4dbd5ae96ebe0c12f3eee0eb9e
This commit is contained in:
commit
23991ee53a
1 changed files with 3 additions and 0 deletions
|
@ -253,6 +253,9 @@ void *PosixLockedPageAllocator::AllocateLocked(size_t len, bool *lockingSuccess)
|
|||
}
|
||||
if (addr) {
|
||||
*lockingSuccess = mlock(addr, len) == 0;
|
||||
#ifdef MADV_DONTDUMP
|
||||
madvise(addr, len, MADV_DONTDUMP);
|
||||
#endif
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue