mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-02-09 13:15:14 +08:00
Deploying to gh-pages from @ eunomia-bpf/bpf-developer-tutorial@3a67878cff 🚀
This commit is contained in:
@@ -6200,7 +6200,7 @@ const volatile int target_ppid = 0;
|
||||
// of the PID to hide. This becomes the name
|
||||
// of the folder in /proc/
|
||||
const volatile int pid_to_hide_len = 0;
|
||||
const volatile char pid_to_hide[max_pid_len];
|
||||
const volatile char pid_to_hide[MAX_PID_LEN];
|
||||
|
||||
// struct linux_dirent64 {
|
||||
// u64 d_ino; /* 64-bit inode number */
|
||||
@@ -6268,7 +6268,7 @@ int handle_getdents_exit(struct trace_event_raw_sys_exit *ctx)
|
||||
struct linux_dirent64 *dirp = 0;
|
||||
int pid = pid_tgid >> 32;
|
||||
short unsigned int d_reclen = 0;
|
||||
char filename[max_pid_len];
|
||||
char filename[MAX_PID_LEN];
|
||||
|
||||
unsigned int bpos = 0;
|
||||
unsigned int *pBPOS = bpf_map_lookup_elem(&map_bytes_read, &pid_tgid);
|
||||
@@ -6342,7 +6342,7 @@ int handle_getdents_patch(struct trace_event_raw_sys_exit *ctx)
|
||||
bpf_probe_read_user(&d_reclen, sizeof(d_reclen), &dirp->d_reclen);
|
||||
|
||||
// Debug print
|
||||
char filename[max_pid_len];
|
||||
char filename[MAX_PID_LEN];
|
||||
bpf_probe_read_user_str(&filename, pid_to_hide_len, dirp_previous->d_name);
|
||||
filename[pid_to_hide_len-1] = 0x00;
|
||||
bpf_printk("[PID_HIDE] filename previous %s\n", filename);
|
||||
|
||||
Reference in New Issue
Block a user