Skip to content

Commit f363f1c

Browse files
authored
pkg/ebpf: fix bug in support for arg types (#2228)
In tracee.bpf.c we use arg types to determine syscall arguments. Recent feature changed arguments types enum values, causing bug in argument parsing of syscalls. This commit fix this issue and add unsupported basic types should be supported in parsing.
1 parent dd41bad commit f363f1c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

pkg/bufferdecoder/eventsreader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ type ArgType uint8
1818

1919
const (
2020
noneT ArgType = iota
21-
u8T
2221
intT
2322
uintT
2423
longT
@@ -36,6 +35,7 @@ const (
3635
credT
3736
intArr2T
3837
uint64ArrT
38+
u8T
3939
)
4040

4141
// These types don't match the ones defined in the ebpf code since they are not being used by syscalls arguments.

pkg/ebpf/c/tracee.bpf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ enum argument_type_e
157157
CRED_T,
158158
INT_ARR_2_T,
159159
UINT64_ARR_T,
160+
U8_T,
160161
TYPE_MAX = 255UL
161162
};
162163

@@ -2443,6 +2444,12 @@ static __always_inline int save_args_to_submit_buf(event_data_t *data, u64 types
24432444
case POINTER_T:
24442445
size = sizeof(void *);
24452446
break;
2447+
case U8_T:
2448+
size = sizeof(u8);
2449+
break;
2450+
case U16_T:
2451+
size = sizeof(u16);
2452+
break;
24462453
case STR_T:
24472454
rc = save_str_to_buf(data, (void *) args->args[i], index);
24482455
break;

0 commit comments

Comments
 (0)