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

pkg/sensors: cleanup kprobe entry from table on destroy #1604

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Oct 17, 2023

Backport for #1562

[upstream commit 5b31544]

Commit 310846e introduced a cleanup of the kprobe table entry on unload, which introduced some issues because unload is using when disabling sensors (that might be re-enabled later). Previous pre and post-hooks are still useful for resources management on unload.

The kprobe table entry is added on creation (not load) and then it must be cleaned up on deletion introducing the new sensor.Destroy() method. 'Destroy' expresses the idea that the sensor is not usable past this point and must be recreated to be loaded.

Fixes a regression on enable/disable sensors that would prevent a sensor from being enabled.

[upstream commit 5b31544]

Commit 310846e introduced a cleanup of
the kprobe table entry on unload, which introduced some issues because
unload is using when disabling sensors (that might be re-enabled later).
Previous pre and post-hooks are still useful for resources management on
unload.

The kprobe table entry is added on creation (not load) and then it must
be cleaned up on deletion introducing the new sensor.Destroy() method.
'Destroy' expresses the idea that the sensor is not usable past this
point and must be recreated to be loaded.

Signed-off-by: Mahe Tardy <[email protected]>
@mtardy mtardy added the kind/backport This PR provides functionality previously merged into master. label Oct 17, 2023
@mtardy mtardy requested a review from a team as a code owner October 17, 2023 14:51
@mtardy mtardy requested review from tixxdz and kkourt and removed request for a team and tixxdz October 17, 2023 14:51
[upstream commit 19babbb]

This should make sure the regression #1489 doesn't appear
anymore: disabling/enabling broke because we cleaned up the generic
kprobe table on unloading, which should have been done only on
destroying the probe.

Signed-off-by: Mahe Tardy <[email protected]>
[upstream commit 0690282]

The testutils Config.TetragonLib (or in the end ConfigDefault.TetragonLib)
was never written to the actual option.Config.HubbleLib. We noticed it
was done manually all over the place in tests so this commit adds it in
TestSensorRun that runs in TestMain.

Signed-off-by: Mahe Tardy <[email protected]>
@mtardy mtardy force-pushed the pr/mtardy/backport-hook-regression branch from 130e4d5 to 7a85c0d Compare October 17, 2023 15:04
@mtardy mtardy added the release-note/bug This PR fixes an issue in a previous release of Tetragon. label Oct 18, 2023
@mtardy mtardy merged commit e575bff into v0.11 Oct 18, 2023
23 of 25 checks passed
@mtardy mtardy deleted the pr/mtardy/backport-hook-regression branch October 18, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/backport This PR provides functionality previously merged into master. release-note/bug This PR fixes an issue in a previous release of Tetragon.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants