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

chore(falco_scripts): Update falco-driver-loader cleaning phase #1950

Merged
merged 6 commits into from
Apr 29, 2022

Conversation

Andreagit97
Copy link
Member

@Andreagit97 Andreagit97 commented Mar 20, 2022

Signed-off-by: Andrea Terzolo [email protected]

What type of PR is this?

/kind cleanup

/kind feature

Any specific area of the project related to this PR?

/area build

What this PR does / why we need it:

This PR slightly modifies the behavior of the falco-driver-loader script. Now the cleaning phase enforces the deletion of the kernel module if it is still loaded. If the script is not able to detach the module, it waits until the user removes it manually. The user can do this by following some specific instructions that will be provided in the documentation... This is necessary to avoid incompatibility issues with driver versions, obtaining errors like the following:

Runtime error: Kernel module does not support PPM_IOCTL_GET_API_VERSION. Exiting.

This happens with Falco 0.31.1 because we introduced a mechanism to detect incompatible driver versions.

This new cleaning phase is called every time we try to load a new kernel module typing falco-driver-loader or explicitly calling it with falco-driver-loader --clean.

Since both .deb and .rpm packages have to perform the same cleaning phase when uninstalled now they call directly falco-driver-loader --clean.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@Andreagit97
Copy link
Member Author

The dkms status output changed from version v2.8.6 (dell/dkms@f83b758):

Before v2.8.6 dkms status prints:

module, version, kernel, architecture

After:

module/version, kernel, architecture

Before v2.8.6 it seems that the format never changed. The last commit I considered has more than 15 years and it keeps the same format, so we should be pretty safe...

The last commit I checked: https://github.com/dell/dkms/blob/3abe63b850b4714df34972ae4486f0c0689022f0/dkms#L1470

I addressed this different output with the following line, for more info look directly at the code in this PR:

DRIVER_VERSIONS=$(dkms status -m "${KMOD_NAME}" | tr -d "," | tr "/" " " | cut -d' ' -f2)

@jasondellaluce
Copy link
Contributor

/milestone 0.32.0

@poiana poiana added this to the 0.32.0 milestone Mar 24, 2022
@Andreagit97
Copy link
Member Author

/retest

@Andreagit97 Andreagit97 force-pushed the packages_cleaning_phase branch 2 times, most recently from 7bfc2e3 to 79d947a Compare April 25, 2022 20:32
@Andreagit97 Andreagit97 changed the title [WIP] chore(falco_scripts): Update falco-driver-loader cleaning phase chore(falco_scripts): Update falco-driver-loader cleaning phase Apr 25, 2022
Copy link
Member

@leogr leogr 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 Apr 27, 2022

LGTM label has been added.

Git tree hash: 147f4a42a917025f83a9e7ce5d0cc231d8f2b385

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 Apr 29, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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

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 21b127e into falcosecurity:master Apr 29, 2022
@Andreagit97 Andreagit97 deleted the packages_cleaning_phase branch October 15, 2022 18:14
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