Compare commits

...

2 Commits

Author SHA1 Message Date
6b60e04513 don't seal sync_mem 2025-10-27 10:15:55 +01:00
b72ea11712 get shared_memory_heap from git repository 2025-10-23 18:20:47 +02:00
3 changed files with 4 additions and 5 deletions

3
Cargo.lock generated
View File

@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "agent_lib"
@@ -26,6 +26,7 @@ checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5"
[[package]]
name = "shared_memory_heap"
version = "0.1.0"
source = "git+https://gitea.rixxc.de/rixxc/shared_memory_heap.git#ef9bcc94fb04d7191514a249c78d608d2f7cb9a6"
dependencies = [
"libc",
]

View File

@@ -8,4 +8,4 @@ edition = "2021"
[dependencies]
anyhow = "1.0.82"
libc = "0.2.153"
shared_memory_heap = { path = "../shared_memory_heap" }
shared_memory_heap = { git = "https://gitea.rixxc.de/rixxc/shared_memory_heap.git" }

View File

@@ -16,7 +16,7 @@ unsafe impl Send for Agent {}
impl Agent {
pub(crate) unsafe fn new(agent_path: &Path, keyfile_path: &Path) -> Result<Self> {
let data_fd = get_shared_mem_fd();
let sync_fd = memfd_create("sync\x00".as_ptr() as *const c_char, MFD_ALLOW_SEALING);
let sync_fd = memfd_create("sync\x00".as_ptr() as *const c_char, 0);
if sync_fd <= 0 {
bail!("creating memfd failed");
@@ -36,8 +36,6 @@ impl Agent {
0,
) as *mut usize;
fcntl(sync_fd, F_ADD_SEALS, F_SEAL_FUTURE_WRITE);
if sync_mem == MAP_FAILED as *mut usize {
bail!("mmap failed");
}