fix(modern_bpf): skip syscall -1#2938
Merged
poiana merged 1 commit intofalcosecurity:masterfrom Apr 7, 2026
Merged
Conversation
syscall id -1 means the system call was interrupted or cancelled (e.g. by ptrace or a signal) and is not processed normally. Unfortunately, we also picked -1 as the "syscall does not exist" value for socketcall on architectures that do not support it. This means that syscalls interrupted by signals were actually treated as socketcall and dispatched based on whatever happened to be in the registers. This led to tons of bogus SOCKET_X (mostly, but not only) events being reported, filling the fd table with fds that would never get cleaned up (they never really existed so nobody closed them). Combined with copying the fd table on creating a new process, this led to fd table size explosion (thousands of bogus fds copied to all children). Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Contributor
|
LGTM label has been added. DetailsGit tree hash: 1ff1e4e2e04b9f16f17b4f24027b3d4cea895812 |
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, gnosek, irozzo-1A The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2938 +/- ##
=======================================
Coverage 74.90% 74.90%
=======================================
Files 297 297
Lines 31498 31498
Branches 4979 4979
=======================================
Hits 23595 23595
Misses 7903 7903
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area driver-modern-bpf
Does this PR require a change in the driver versions?
What this PR does / why we need it:
syscall id -1 means the system call was interrupted or cancelled (e.g. by ptrace or a signal) and is not processed normally.
Unfortunately, we also picked -1 as the "syscall does not exist" value for socketcall on architectures that do not support it. This means that syscalls interrupted by signals were actually treated as socketcall and dispatched based on whatever happened to be in the registers.
This led to tons of bogus SOCKET_X (mostly, but not only) events being reported, filling the fd table with fds that would never get cleaned up (they never really existed so nobody closed them).
Combined with copying the fd table on creating a new process, this led to fd table size explosion (thousands of bogus fds copied to all children).
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: