From 6b4e012065556c65b4d759fa876559a0904f5474 Mon Sep 17 00:00:00 2001 From: Quentin JEROME Date: Fri, 9 Dec 2022 11:16:46 +0100 Subject: [PATCH 1/3] Issue: zero crate has moved to 0.1.3 and build fails since then - fixed Cargo.toml files to use version 0.1.2 instead of 0.1, which would take latest version available. Signed-off-by: Quentin JEROME --- bpf-sys/Cargo.toml | 11 ++++++++--- redbpf/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bpf-sys/Cargo.toml b/bpf-sys/Cargo.toml index 5e4f363..6e4eca3 100644 --- a/bpf-sys/Cargo.toml +++ b/bpf-sys/Cargo.toml @@ -5,14 +5,17 @@ description = "Bindings for libbpf" repository = "https://github.com/foniod/redbpf" homepage = "https://foniod.org" documentation = "https://docs.rs/bpf-sys" -authors = ["Peter Parkanyi ", "Junyeong Jeong "] +authors = [ + "Peter Parkanyi ", + "Junyeong Jeong ", +] links = "bpf" edition = "2018" license = "MIT OR Apache-2.0" keywords = ["bpf", "ebpf", "ffi"] [dependencies] -zero = "0.1" +zero = "0.1.2" libc = "0.2" regex = { version = "1.5" } glob = "0.3.0" @@ -20,7 +23,9 @@ libbpf-sys = "0.6.2" [build-dependencies] cc = "1.0" -bindgen = {version = "0.59.2", default-features = false, features = ["runtime"]} +bindgen = { version = "0.59.2", default-features = false, features = [ + "runtime", +] } libc = "0.2" glob = "0.3.0" diff --git a/redbpf/Cargo.toml b/redbpf/Cargo.toml index 09c2de0..4aaf81d 100644 --- a/redbpf/Cargo.toml +++ b/redbpf/Cargo.toml @@ -18,7 +18,7 @@ maintenance = { status = "actively-developed" } bpf-sys = { path = "../bpf-sys", version = "2.3.0" } libbpf-sys = "0.6.2" goblin = "0.4" -zero = "0.1" +zero = "0.1.2" libc = "0.2" bindgen = {version = "0.59.2", default-features = false, features = ["runtime"]} regex = "1.0" From 23e1c99ea2d8015faa9a26a757411cee5e042d13 Mon Sep 17 00:00:00 2001 From: Quentin JEROME Date: Fri, 9 Dec 2022 14:54:30 +0100 Subject: [PATCH 2/3] Added VMAs parsing read accessors: - vm_area_struct read accessors - rb_node read accessors Signed-off-by: Quentin JEROME --- redbpf-probes/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redbpf-probes/build.rs b/redbpf-probes/build.rs index 5a6cf1f..b96b1ec 100644 --- a/redbpf-probes/build.rs +++ b/redbpf-probes/build.rs @@ -77,6 +77,8 @@ const READ_ACCESSORS: &[&'static str] = &[ // task "task_struct", "mm_struct", + "vm_area_struct", + "rb_node", "cred", ]; From f322c7285d9046f25c1030cd1ed28d6a9b780d9d Mon Sep 17 00:00:00 2001 From: Quentin JEROME Date: Mon, 16 Jan 2023 13:42:52 +0100 Subject: [PATCH 3/3] Added useful net structure read accessors socket, msghdr, iov_iter, iovec Signed-off-by: Quentin JEROME --- redbpf-probes/build.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redbpf-probes/build.rs b/redbpf-probes/build.rs index b96b1ec..1e26325 100644 --- a/redbpf-probes/build.rs +++ b/redbpf-probes/build.rs @@ -57,6 +57,10 @@ const XDP_TYPES: &[&'static str] = &[ const READ_ACCESSORS: &[&'static str] = &[ // network + "socket", + "msghdr", + "iov_iter", + "iovec", "sock", "sockaddr", "sockaddr_in",