Skip to content
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

fix: Prevent loading syscall-specific BPF programs for non-syscall events #4202

Merged

Conversation

yanivagman
Copy link
Collaborator

1. Explain what the PR does

Previously, tracee incorrectly assumed all tailcall indexes were syscall IDs, leading to unnecessary loading of syscall-specific BPF programs. This caused a resource leak due to unused tracepoint attachments. The issue is now fixed by only removing the code which attaches these programs, as we explicitly define it in the event dependencies.

2. Explain how to test it

Run tracee with
sudo ./dist/tracee -e sched_process_exec
Before this fix, sys_enter and sys_exit events were attached, after this fix they are not anymore.
Use the following command to verify:
sudo bpftool link

3. Other comments

…ents.

Previously, tracee incorrectly assumed all tailcall indexes were syscall IDs,
leading to unnecessary loading of syscall-specific BPF programs.
This caused a resource leak due to unused tracepoint attachments.
The issue is now fixed by only removing the code which attaches these
programs, as we explicitly define it in the event dependencies.
Copy link
Collaborator

@OriGlassman OriGlassman left a comment

Choose a reason for hiding this comment

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

LGTM

@yanivagman yanivagman merged commit 6762ab7 into aquasecurity:main Jul 28, 2024
33 checks passed
@yanivagman yanivagman deleted the fix_sys_enter_invalid_attach branch July 28, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants