diff --git a/Cargo.toml b/Cargo.toml index a1f4bfc6..88dae9b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,6 @@ edition = "2021" json = ["serde", "serde_json"] [dependencies] -libc = "^0.2.39" +libc = "^0.2.153" serde = { version = "^1.0.27", features = ["derive"], optional = true} serde_json = {version = "^1.0.9", optional = true} diff --git a/src/backend/bpf.rs b/src/backend/bpf.rs index a29422a6..aef397a6 100644 --- a/src/backend/bpf.rs +++ b/src/backend/bpf.rs @@ -75,7 +75,7 @@ pub(crate) fn build_arch_validation_sequence(target_arch: TargetArch) -> Vec for u32 { fn from(action: SeccompAction) -> Self { match action { SeccompAction::Allow => SECCOMP_RET_ALLOW, - SeccompAction::Errno(x) => SECCOMP_RET_ERRNO | (x & SECCOMP_RET_MASK), + SeccompAction::Errno(x) => SECCOMP_RET_ERRNO | (x & SECCOMP_RET_DATA), SeccompAction::KillThread => SECCOMP_RET_KILL_THREAD, SeccompAction::KillProcess => SECCOMP_RET_KILL_PROCESS, SeccompAction::Log => SECCOMP_RET_LOG, - SeccompAction::Trace(x) => SECCOMP_RET_TRACE | (x & SECCOMP_RET_MASK), + SeccompAction::Trace(x) => SECCOMP_RET_TRACE | (x & SECCOMP_RET_DATA), SeccompAction::Trap => SECCOMP_RET_TRAP, } } diff --git a/src/lib.rs b/src/lib.rs index 2e93b78b..10f3a79e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -208,10 +208,6 @@ pub use backend::{ SeccompCmpOp, SeccompCondition, SeccompFilter, SeccompRule, TargetArch, }; -// Until https://github.com/rust-lang/libc/issues/3342 is fixed, define locally -// From -const SECCOMP_SET_MODE_FILTER: libc::c_int = 1; - // BPF structure definition for filter array. // See /usr/include/linux/filter.h . #[repr(C)] @@ -361,7 +357,7 @@ fn apply_filter_with_flags(bpf_filter: BpfProgramRef, flags: libc::c_ulong) -> R let rc = unsafe { libc::syscall( libc::SYS_seccomp, - SECCOMP_SET_MODE_FILTER, + libc::SECCOMP_SET_MODE_FILTER, flags, bpf_prog_ptr, )