mirror of
https://github.com/eunomia-bpf/bpf-developer-tutorial.git
synced 2026-04-08 21:30:29 +08:00
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:
@@ -52,7 +52,7 @@ int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter* ctx
|
|||||||
{
|
{
|
||||||
u64 id;
|
u64 id;
|
||||||
pid_t pid, tgid;
|
pid_t pid, tgid;
|
||||||
struct event event;
|
struct event event={0};
|
||||||
struct task_struct *task;
|
struct task_struct *task;
|
||||||
|
|
||||||
uid_t uid = (u32)bpf_get_current_uid_gid();
|
uid_t uid = (u32)bpf_get_current_uid_gid();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ int tracepoint__syscalls__sys_enter_execve(struct trace_event_raw_sys_enter* ctx
|
|||||||
{
|
{
|
||||||
u64 id;
|
u64 id;
|
||||||
pid_t pid, tgid;
|
pid_t pid, tgid;
|
||||||
struct event event;
|
struct event event={0};
|
||||||
struct task_struct *task;
|
struct task_struct *task;
|
||||||
|
|
||||||
uid_t uid = (u32)bpf_get_current_uid_gid();
|
uid_t uid = (u32)bpf_get_current_uid_gid();
|
||||||
|
|||||||
Reference in New Issue
Block a user