disable coredumps for process

This commit is contained in:
2024-09-25 13:46:05 +02:00
parent 7e45cd719e
commit f243b7b95c

View File

@@ -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<String> = env::args().collect();
let shared_fd: c_int = args[0]