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(libscap/gvisor): use consistent new/delete functions for gvisor platform #1599

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

LucaGuerra
Copy link
Contributor

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind cleanup

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area libscap-engine-gvisor

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

It is undefined behavior to allocate memory with calloc() and release it with delete(). This fixes it. In C++, new T(); will zero-initialize the allocated memory. Don't believe me? The standard says so and the compiler agrees (below):
Screenshot 2023-12-20 at 15 42 43

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link
Contributor

@incertum incertum 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.14.1

@poiana poiana added this to the 0.14.1 milestone Dec 20, 2023
@poiana poiana added the lgtm label Dec 20, 2023
@poiana
Copy link
Contributor

poiana commented Dec 20, 2023

LGTM label has been added.

Git tree hash: ed2ea167bf14b4bd94848ebb2cde864fefb722a0

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 Dec 20, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, incertum, LucaGuerra

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,LucaGuerra,incertum]

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 e2dbeb3 into falcosecurity:master Dec 20, 2023
28 checks passed
@LucaGuerra LucaGuerra deleted the fix/gvisor-calloc-new branch December 21, 2023 09:58
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.

4 participants