From 02e68a661d4d46a401bb8956c1e30e2f941cbe60 Mon Sep 17 00:00:00 2001 From: Kristofer Peterson Date: Sun, 3 Sep 2023 05:38:18 +0100 Subject: [PATCH] mmap: fd should be -1 when creating anonymous mappings (#508) --- src/memory_management.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory_management.rs b/src/memory_management.rs index 2097c56b..9c7bac5e 100644 --- a/src/memory_management.rs +++ b/src/memory_management.rs @@ -102,7 +102,7 @@ pub unsafe fn allocate_pages(size_in_bytes: usize) -> Result<*mut u8, EbpfError> size_in_bytes, libc::PROT_READ | libc::PROT_WRITE, libc::MAP_ANONYMOUS | libc::MAP_PRIVATE, - 0, + -1, 0, ); #[cfg(target_os = "windows")]