Fix failed to run execsnoop (#28)

* Update README.md

without having initialised it, the verifier complains, because reading uninitialised memory from the kernel introduces a security risk.

* Update execsnoop.bpf.c

without having initialised it, the verifier complains, because reading uninitialised memory from the kernel introduces a security risk.
This commit is contained in:
chichina
2023-04-25 15:12:51 +08:00
committed by GitHub
parent 4343fd8e17
commit 39a0f4a1a7
2 changed files with 2 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter* ctx
{
u64 id;
pid_t pid, tgid;
struct event event;
struct event event={0};
struct task_struct *task;
uid_t uid = (u32)bpf_get_current_uid_gid();

View File

@@ -15,7 +15,7 @@ int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter* ctx
{
u64 id;
pid_t pid, tgid;
struct event event;
struct event event={0};
struct task_struct *task;
uid_t uid = (u32)bpf_get_current_uid_gid();