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(fillers): remove user-triggerable assertions in flag conversion code #1764

Merged
merged 5 commits into from
Mar 26, 2024

Conversation

gnosek
Copy link
Contributor

@gnosek gnosek commented Mar 25, 2024

What type of PR is this?

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

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

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

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

API patch version bump? 🤷‍♂️

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:

With debug builds, it's trivial to hit an ASSERT in fcntl or shutdown, just by passing invalid values for cmd or how, respectively.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Copy link

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

FedeDP
FedeDP previously approved these changes Mar 25, 2024
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 Mar 25, 2024

LGTM label has been added.

Git tree hash: c20a7fc4aa703f7a200a18439f745c0825343791

@FedeDP
Copy link
Contributor

FedeDP commented Mar 25, 2024

/milestone next-driver

@poiana poiana added this to the next-driver milestone Mar 25, 2024
@@ -273,6 +273,7 @@ or GPL2.txt for full copies of the license.
#define PPM_SHUT_RD 0
#define PPM_SHUT_WR 1
#define PPM_SHUT_RDWR 2
#define PPM_SHUT_UNKNOWN 0xffff
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add the string mapping here:

const struct ppm_name_value shutdown_how[] = {

@FedeDP FedeDP self-requested a review March 26, 2024 08:30
@leogr
Copy link
Member

leogr commented Mar 26, 2024

Please double check driver/SCHEMA_VERSION file. See versioning.

/hold

This PR does not change the event schema, so there is no need to bump the SCHEMA_VERSION
/unhold

On the other hand, if I understood correctly, this change patches the way the kernel-space<>user-space communicates and, thus, the driver API. Still, the change seems to be backward compatible, so we should only bump the patch number of the API_VERSION. Right? @gnosek

@@ -1 +1 @@
8.0.2
8.0.1
Copy link
Contributor

@FedeDP FedeDP Mar 26, 2024

Choose a reason for hiding this comment

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

api_version--

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-ENOCOFFEE. Thanks! :)

For example, <linux/net.h> defines the constants as enum variants,
not as preprocessor macros, making the original code work by accident
(because SHUT_* are the same as PPM_SHUT_*).

Signed-off-by: Grzegorz Nosek <[email protected]>
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 poiana added the lgtm label Mar 26, 2024
@poiana
Copy link
Contributor

poiana commented Mar 26, 2024

LGTM label has been added.

Git tree hash: 210f652e793778e101ef41d27501f65112d4efaa

Copy link
Member

@Andreagit97 Andreagit97 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 Mar 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

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:

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 c66b891 into falcosecurity:master Mar 26, 2024
52 of 53 checks passed
@gnosek gnosek deleted the flag-fixes branch March 26, 2024 14:51
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.

6 participants