Skip to content

Commit

Permalink
tracee-ebpf: fix regression - program too large in kernel 4.19
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivagman committed Aug 16, 2021
1 parent 8a43404 commit 3baa952
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tracee-ebpf/tracee/tracee.bpf.c
Expand Up @@ -1321,7 +1321,7 @@ static __always_inline int save_str_arr_to_buf(buf_t *submit_p, const char __use
if (*off > MAX_PERCPU_BUFSIZE - sizeof(int))
// Satisfy validator
goto out;
__builtin_memcpy(&(submit_p->buf[*off]), &sz, sizeof(int));
bpf_probe_read(&(submit_p->buf[*off]), sizeof(int), &sz);
*off += sz + sizeof(int);
elem_num++;
continue;
Expand All @@ -1341,7 +1341,7 @@ static __always_inline int save_str_arr_to_buf(buf_t *submit_p, const char __use
if (*off > MAX_PERCPU_BUFSIZE - sizeof(int))
// Satisfy validator
goto out;
__builtin_memcpy(&(submit_p->buf[*off]), &sz, sizeof(int));
bpf_probe_read(&(submit_p->buf[*off]), sizeof(int), &sz);
*off += sz + sizeof(int);
elem_num++;
}
Expand Down Expand Up @@ -1385,7 +1385,7 @@ static __always_inline int save_args_str_arr_to_buf(buf_t *submit_p, const char
if (*off > MAX_PERCPU_BUFSIZE - sizeof(int))
// Satisfy validator
goto out;
__builtin_memcpy(&(submit_p->buf[*off]), &sz, sizeof(int));
bpf_probe_read(&(submit_p->buf[*off]), sizeof(int), &sz);
*off += sz + sizeof(int);
elem_num--;
count++;
Expand All @@ -1407,7 +1407,7 @@ static __always_inline int save_args_str_arr_to_buf(buf_t *submit_p, const char
if (*off > MAX_PERCPU_BUFSIZE - sizeof(int))
// Satisfy validator
goto out;
__builtin_memcpy(&(submit_p->buf[*off]), &sz, sizeof(int));
bpf_probe_read(&(submit_p->buf[*off]), sizeof(int), &sz);
*off += sz + sizeof(int);
elem_num--;
count++;
Expand Down

0 comments on commit 3baa952

Please sign in to comment.