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/libscap): initialize bpf_engine.m_attached_progs.efd to -1 #1449

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

NitroCao
Copy link
Contributor

@NitroCao NitroCao commented Oct 26, 2023

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area libscap-engine-bpf

Does this PR require a change in the driver versions?

What this PR does / why we need it:

alloc_handle() doesn't initialize engine->m_attached_progs[j].efd to -1, which leads to detach_bpf_prog() closing those file descriptors which are equal to 0 unexpectedly.

Which issue(s) this PR fixes:

Fixes #1448

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@poiana
Copy link
Contributor

poiana commented Oct 26, 2023

Welcome @NitroCao! It looks like this is your first PR to falcosecurity/libs 🎉

Signed-off-by: Nitro Cao <jaycecao520@gmail.com>
@FedeDP
Copy link
Contributor

FedeDP commented Oct 26, 2023

Thanks for the quick PR!
Putting
/milestone 0.14.0

but it will most probably be 0.13.4 :)

@poiana poiana added this to the 0.14.0 milestone Oct 26, 2023
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
Contributor

poiana commented Oct 26, 2023

LGTM label has been added.

Git tree hash: 0b327fad0909e33fe0a619961e1d43186fe0e912

@FedeDP
Copy link
Contributor

FedeDP commented Oct 26, 2023

/cc @Andreagit97

/hold

@FedeDP
Copy link
Contributor

FedeDP commented Oct 26, 2023

/milestone 0.13.4

@poiana poiana modified the milestones: 0.14.0, 0.13.4 Oct 26, 2023
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

@poiana
Copy link
Contributor

poiana commented Oct 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

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

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 [FedeDP,jasondellaluce]

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

@FedeDP
Copy link
Contributor

FedeDP commented Oct 26, 2023

/unhold

@poiana poiana merged commit 2d118d7 into falcosecurity:master Oct 26, 2023
26 checks passed
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.

Uninitialized efd field in alloc_handle() leads to undefined behavior
4 participants