Skip to content

tetragon: Remove unused variables #183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 5 additions & 25 deletions bpf/process/generic_calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ generic_process_event0(struct pt_regs *ctx, struct bpf_map_def *heap_map,
{
struct execve_map_value *enter;
struct msg_generic_kprobe *e;
unsigned long a0, a1, a2, a3, a4;
struct event_config *config;
unsigned long a0;
bool walker = 0;
__u32 ppid;
int zero = 0;
Expand All @@ -31,10 +31,6 @@ generic_process_event0(struct pt_regs *ctx, struct bpf_map_def *heap_map,
return 0;

a0 = e->a0;
a1 = e->a1;
a2 = e->a2;
a3 = e->a3;
a4 = e->a4;

e->common.flags = 0;
e->common.pad[0] = 0;
Expand Down Expand Up @@ -146,10 +142,10 @@ generic_process_event1(void *ctx, struct bpf_map_def *heap_map,
struct bpf_map_def *map, struct bpf_map_def *tailcals,
struct bpf_map_def *config_map)
{
unsigned long a0, a1, a2, a3, a4;
struct execve_map_value *enter;
struct msg_generic_kprobe *e;
struct event_config *config;
unsigned long a1;
int zero = 0;
bool walker = 0;
long ty, total;
Expand All @@ -170,11 +166,7 @@ generic_process_event1(void *ctx, struct bpf_map_def *heap_map,

total = e->common.size;

a0 = e->a0;
a1 = e->a1;
a2 = e->a2;
a3 = e->a3;
a4 = e->a4;

ty = config->arg1;
if (total < MAX_TOTAL) {
Expand All @@ -200,10 +192,10 @@ generic_process_event2(void *ctx, struct bpf_map_def *heap_map,
struct bpf_map_def *map, struct bpf_map_def *tailcals,
struct bpf_map_def *config_map)
{
unsigned long a0, a1, a2, a3, a4;
struct execve_map_value *enter;
struct msg_generic_kprobe *e;
struct event_config *config;
unsigned long a2;
int zero = 0;
bool walker = 0;
long ty, total;
Expand All @@ -224,11 +216,7 @@ generic_process_event2(void *ctx, struct bpf_map_def *heap_map,

total = e->common.size;

a0 = e->a0;
a1 = e->a1;
a2 = e->a2;
a3 = e->a3;
a4 = e->a4;

ty = config->arg2;
if (total < MAX_TOTAL) {
Expand All @@ -254,10 +242,10 @@ generic_process_event3(void *ctx, struct bpf_map_def *heap_map,
struct bpf_map_def *map, struct bpf_map_def *tailcals,
struct bpf_map_def *config_map)
{
unsigned long a0, a1, a2, a3, a4;
struct execve_map_value *enter;
struct msg_generic_kprobe *e;
struct event_config *config;
unsigned long a3;
int zero = 0;
bool walker = 0;
long ty, total;
Expand All @@ -278,11 +266,7 @@ generic_process_event3(void *ctx, struct bpf_map_def *heap_map,

total = e->common.size;

a0 = e->a0;
a1 = e->a1;
a2 = e->a2;
a3 = e->a3;
a4 = e->a4;

/* Arg filter and copy logic */
ty = config->arg3;
Expand All @@ -309,10 +293,10 @@ generic_process_event4(void *ctx, struct bpf_map_def *heap_map,
struct bpf_map_def *map, struct bpf_map_def *tailcals,
struct bpf_map_def *config_map)
{
unsigned long a0, a1, a2, a3, a4;
struct execve_map_value *enter;
struct msg_generic_kprobe *e;
struct event_config *config;
unsigned long a4;
int zero = 0;
bool walker = 0;
long ty, total;
Expand All @@ -333,10 +317,6 @@ generic_process_event4(void *ctx, struct bpf_map_def *heap_map,

total = e->common.size;

a0 = e->a0;
a1 = e->a1;
a2 = e->a2;
a3 = e->a3;
a4 = e->a4;

ty = config->arg4;
Expand Down
4 changes: 1 addition & 3 deletions bpf/process/types/basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1282,11 +1282,9 @@ read_call_arg(void *ctx, struct msg_generic_kprobe *e, int index, int type,
size = copy_char_iovec(ctx, orig_off, arg, argm, e);
break;
case const_buf_type: {
int err;

// bound size to 1023 to help the verifier out
size = argm & 0x03ff;
err = probe_read(args, size, (char *)arg);
probe_read(args, size, (char *)arg);
break;
}
default:
Expand Down