Skip to content

Commit

Permalink
Convert max binary size to a define
Browse files Browse the repository at this point in the history
Signed-off-by: Anastasios Papagiannis <tasos.papagiannnis@gmail.com>
  • Loading branch information
tpapagian committed Feb 24, 2023
1 parent 4586261 commit 2fc6811
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bpf/lib/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
#define __ASM_ARGSBUFFER 976
#define ARGSBUFFERMASK (ARGSBUFFER - 1)
#define MAXARGMASK (MAXARG - 1)
#define PATHNAME_SIZE 256

/* Task flags */
#ifndef PF_KTHREAD
Expand Down Expand Up @@ -316,7 +317,7 @@ struct {

struct execve_heap {
union {
char pathname[256];
char pathname[PATHNAME_SIZE];
char maxpath[4096];
};
};
Expand Down
2 changes: 1 addition & 1 deletion bpf/process/bpf_execve_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ event_filename_builder(void *ctx, struct msg_process *curr, __u32 curr_pid, __u3
if (!heap)
return 0;

memset(heap->pathname, 0, 256);
memset(heap->pathname, 0, PATHNAME_SIZE);
probe_read_str(heap->pathname, size, filename);
value = map_lookup_elem(&names_map, heap->pathname);
if (value)
Expand Down

0 comments on commit 2fc6811

Please sign in to comment.