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(userspace): check the supported number of online CPUs with modern bpf #2575

Merged
merged 2 commits into from May 25, 2023

Conversation

Andreagit97
Copy link
Member

@Andreagit97 Andreagit97 commented May 24, 2023

What type of PR is this?

/kind bug

/kind cleanup

Any specific area of the project related to this PR?

/area engine

/area tests

What this PR does / why we need it:

Right now the modern bpf config cpus_for_each_syscall_buffer can be used only with a number of CPUs lower than the actual number of online CPUs in the system. The real fix should be to handle this situation in a better way directly in the modern bpf engine but since we are short in time this patch on the fly in Falco seems the right way to go!

Example:

  • in the system, there is only 1 online CPU
  • by default, the modern bpf opens one buffer every 2 CPUs
  • in the modern bpf engine there is a check that compares the required CPUs with the online ones: so in this case, 2>1 -> the modern bpf engine will generate an error
  • here we have seen exactly what I've just described: https://kubernetes.slack.com/archives/CMWH3EH32/p1684561641886179

Fix:

If the number of required CPUs exceeds the online CPUs number, we set the required number to the number of online CPU

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

fix(userspace): check the supported number of online CPUs with modern bpf

Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Signed-off-by: Andrea Terzolo <andrea.terzolo@polito.it>
Copy link
Contributor

@FedeDP FedeDP left a comment

Choose a reason for hiding this comment

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

/approve

@poiana
Copy link

poiana commented May 25, 2023

LGTM label has been added.

Git tree hash: 2b805f788d09d7298791997021339fbe9fb74e40

Copy link
Contributor

@jasondellaluce jasondellaluce left a comment

Choose a reason for hiding this comment

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

/approve

/milestone 0.35.0

@poiana
Copy link

poiana commented May 25, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, FedeDP, jasondellaluce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Andreagit97,FedeDP,jasondellaluce]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 1098b6f into falcosecurity:master May 25, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants