diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-01-18 14:35:50 +0100 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-01-19 08:31:30 +0100 |
| commit | c51611c27f766bb4f413485bf8a12bca02e98669 (patch) | |
| tree | 61fe6a862d550aa1cbd6c9d7c964f171ebe84afa /src/irmd/main.c | |
| parent | 60b04305d70614580b4f883c0a147507edef3779 (diff) | |
| download | ouroboros-c51611c27f766bb4f413485bf8a12bca02e98669.tar.gz ouroboros-c51611c27f766bb4f413485bf8a12bca02e98669.zip | |
lib: Call mlock() on the shared memory buffers
This prevents them from swapping to disk and killing performance. It
also enhances security a little bit by reducing the risk of sensitive
(even encrypted) data being paged out and captured.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/irmd/main.c')
| -rw-r--r-- | src/irmd/main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c index 57703254..8a2c143d 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1905,6 +1905,9 @@ static int irm_init(void) goto fail_rdrbuff; } + if (shm_rdrbuff_mlock(irmd.rdrb) < 0) + log_warn("Failed to mlock rdrbuff."); + irmd.tpm = tpm_create(IRMD_MIN_THREADS, IRMD_ADD_THREADS, mainloop, NULL); if (irmd.tpm == NULL) { |
