Commit graph

6 commits

Author SHA1 Message Date
Vasil Dimov 09f86e7494
lockedpool: avoid sensitive data in core files (FreeBSD)
This is a followup to
23991ee53 / https://github.com/bitcoin/bitcoin/pull/15600
to also use madvise(2) on FreeBSD to avoid sensitive data allocated
with secure_allocator ending up in core files in addition to preventing
it from going to the swap.
2021-11-05 08:26:11 -04:00
Luke Dashjr b4b98d7ad0
lockedpool: When possible, use madvise to avoid including sensitive information in core dumps 2021-11-05 08:26:04 -04:00
Kaz Wesley b3ddc5e76f LockedPool: avoid quadratic-time allocation
Use separate maps for used/free chunks to avoid linear scan through alloced
chunks for each alloc.
2016-11-02 16:52:56 -07:00
Kaz Wesley 0b59f80625 LockedPool: fix explosion for illegal-sized alloc
Check for unreasonable alloc size in LockedPool rather than lancing through new
Arenas until we improbably find one worthy of the quixotic request or the system
can support no more Arenas.
2016-11-02 14:41:40 -07:00
Pavel Janík 4a9f3c50cc Do not shadow variable, use deprecated MAP_ANON if MAP_ANONYMOUS is not defined. 2016-11-02 14:18:19 +01:00
Wladimir J. van der Laan 4536148b15 support: Add LockedPool
Add a pool for locked memory chunks, replacing LockedPageManager.

This is something I've been wanting to do for a long time. The current
approach of locking objects where they happen to be on the stack or heap
in-place causes a lot of mlock/munlock system call overhead, slowing
down any handling of keys.

Also locked memory is a limited resource on many operating systems (and
using a lot of it bogs down the system), so the previous approach of
locking every page that may contain any key information (but also other
information) is wasteful.
2016-10-27 13:17:25 +02:00