From f243b7b95c2ece65ec8971d4bd3a428594c1f3af Mon Sep 17 00:00:00 2001 From: Aaron Kaiser Date: Wed, 25 Sep 2024 13:46:05 +0200 Subject: [PATCH] disable coredumps for process --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index daef7e3..700026e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use libc::{ - c_int, c_void, mmap, prctl, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE, + c_int, c_void, mmap, prctl, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE, PR_SET_DUMPABLE, PR_SET_SPECULATION_CTRL, PR_SPEC_FORCE_DISABLE, PR_SPEC_STORE_BYPASS, }; use std::fs::File; @@ -26,6 +26,10 @@ fn main() { ); } + unsafe { + assert!(prctl(PR_SET_DUMPABLE, 0) == 0); + } + let args: Vec = env::args().collect(); let shared_fd: c_int = args[0]