From c51611c27f766bb4f413485bf8a12bca02e98669 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 18 Jan 2026 14:35:50 +0100 Subject: 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 Signed-off-by: Sander Vrijders --- src/irmd/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/irmd/main.c') 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) { -- cgit v1.2.3