diff --git a/Cargo.lock b/Cargo.lock index 00a6072..954b3f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,6 @@ dependencies = [ "num_cpus", "page_size", "pete", - "phf", "procfs", "rustix", "syscalls", @@ -420,48 +419,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_macros", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", - "syn 2.0.85", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - [[package]] name = "pin-utils" version = "0.1.0" @@ -536,21 +493,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - [[package]] name = "regex" version = "1.11.1" @@ -630,12 +572,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index 0f70589..e3961e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ nix = { version = "0.29.0", features = ["aio", "event", "fs", "mman", "net", "pr num_cpus = "1.16.0" page_size = "0.6.0" pete = { version = "0.12.0"} -phf = { version = "0.11.2", features = ["macros"] } procfs = "0.16.0" rustix = { version = "0.38.35", features = ["mm", "net", "rand"] } syscalls = "0.6.18" diff --git a/src/main.rs b/src/main.rs index 2413752..7e31e89 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,7 +49,7 @@ use std::{ use pete::{Ptracer, Restart, Stop, Tracee}; use syscalls::Sysno; use utilities::{ - display_unsupported, errno_check, parse_args, set_memory_break, ATTACH, EXITERS, FAILED_ONLY, FOLLOW_FORKS, HALT_FORK_FOLLOW, OUTPUT, OUTPUT_FOLLOW_FORKS, QUIET, SUMMARY + display_unsupported, errno_check, parse_args, set_memory_break, ATTACH, FAILED_ONLY, FOLLOW_FORKS, HALT_FORK_FOLLOW, OUTPUT, OUTPUT_FOLLOW_FORKS, QUIET, SUMMARY }; mod syscall_object; diff --git a/src/syscall_object.rs b/src/syscall_object.rs index cd1c88e..dabb5bb 100644 --- a/src/syscall_object.rs +++ b/src/syscall_object.rs @@ -5,7 +5,7 @@ use crate::{ mlock2, Annotation, ArgContainer, Bytes, BytesPagesRelevant, Category, Flag, LandlockCreateFlags, LandlockRuleTypeFlags, SysArg, SysReturn, }, - utilities::{EXITERS, FOLLOW_FORKS, INTENT, SYSCALL_MAP, UNSUPPORTED}, + utilities::{FOLLOW_FORKS, INTENT, SYSCALL_MAP, UNSUPPORTED}, }; use colored::{ColoredString, Colorize}; @@ -375,7 +375,7 @@ impl SyscallObject { &self, which: usize, ) -> Result, ColoredString> { - if EXITERS.contains(self.sysno.name()) { + if self.is_exiting(){ return Ok(vec![]); } diff --git a/src/syscalls_map.rs b/src/syscalls_map.rs index 135e060..08a8e17 100644 --- a/src/syscalls_map.rs +++ b/src/syscalls_map.rs @@ -10,6 +10,7 @@ use crate::types::{ArgContainer, SysArg, Category, Flag, SysDetails, SysReturn}; // clarify whether a buffer is provided by the user or to be filled by the kernel in the name of the argument (GIVE vs FILL) // switch to MaybeUninit +// TODO! switch to phf later pub fn initialize_syscall_map() -> HashMap { use ArgContainer::*; use SysArg::*; @@ -3345,8 +3346,8 @@ pub fn initialize_syscall_map() -> HashMap { // ( // Sysno::pkey_free // ) + + ]; - ]; - // println!("{} supported", array.len()); array.into_iter().collect() } diff --git a/src/utilities.rs b/src/utilities.rs index 5151a4f..35db06f 100644 --- a/src/utilities.rs +++ b/src/utilities.rs @@ -1,7 +1,6 @@ use crate::{syscalls_map::initialize_syscall_map, types::SysDetails}; use lazy_static::lazy_static; use nix::{errno::Errno, libc::__errno_location, unistd::Pid}; -use phf::phf_set; use procfs::process::{MMapPath, MemoryMap}; use std::{ borrow::BorrowMut, cell::{Cell, RefCell}, collections::HashMap, sync::{atomic::{AtomicBool, Ordering}, Arc, Mutex}, time::Duration @@ -28,10 +27,6 @@ macro_rules! ppp { pub static mut UNSUPPORTED: Vec<&'static str> = Vec::new(); -pub static EXITERS: phf::Set<&'static str> = phf_set! { - "exit", - "exit_group", -}; thread_local! { pub static PRE_CALL_PROGRAM_BREAK_POINT: Cell = Cell::new(0);