add mlockall to lock secret_mem
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
use libc::{
|
use libc::{
|
||||||
c_int, c_void, mmap, prctl, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE, PR_SET_DUMPABLE,
|
c_int, c_void, mlockall, mmap, prctl, MAP_FAILED, MAP_SHARED, MCL_FUTURE, PROT_READ,
|
||||||
PR_SET_SPECULATION_CTRL, PR_SPEC_FORCE_DISABLE, PR_SPEC_STORE_BYPASS,
|
PROT_WRITE, PR_SET_DUMPABLE, PR_SET_SPECULATION_CTRL, PR_SPEC_FORCE_DISABLE,
|
||||||
|
PR_SPEC_STORE_BYPASS,
|
||||||
};
|
};
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::os::fd::AsRawFd;
|
use std::os::fd::AsRawFd;
|
||||||
@@ -70,6 +71,10 @@ fn main() {
|
|||||||
.open(&args[2])
|
.open(&args[2])
|
||||||
.expect("Cannot open KEY_FILE");
|
.expect("Cannot open KEY_FILE");
|
||||||
|
|
||||||
|
unsafe {
|
||||||
|
assert!(mlockall(MCL_FUTURE) == 0);
|
||||||
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
agent_start(
|
agent_start(
|
||||||
shared_memory,
|
shared_memory,
|
||||||
|
|||||||
Reference in New Issue
Block a user