Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions internal/pkg/daemon/bpfrecorder/bpf/bpf_d_path_tetragon.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ prepend(char **buffer, int *buflen, const char *str, int namelen)
if (*buflen < 0) // will never happen - check function comment
return -ENAMETOOLONG;
*buffer -= namelen;
if (namelen <= 0 || namelen > MAX_BUF_LEN)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is call only with a fix length of 10. See

int error = prepend(buf, buflen, " (deleted)", 10);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is not strictly required since this function is not exposed at the moment, but is a good defence in depth for future use.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orbisai0security can you address code review comments?

return -ENAMETOOLONG;
memcpy(*buffer, str, namelen);
return 0;
}
Expand Down
Binary file modified internal/pkg/daemon/bpfrecorder/bpf/recorder.bpf.o.amd64
Binary file not shown.
Binary file modified internal/pkg/daemon/bpfrecorder/bpf/recorder.bpf.o.arm64
Binary file not shown.
Binary file modified internal/pkg/daemon/enricher/auditsource/bpf/enricher.bpf.o.amd64
Binary file not shown.
Binary file modified internal/pkg/daemon/enricher/auditsource/bpf/enricher.bpf.o.arm64
Binary file not shown.
Loading