-
Notifications
You must be signed in to change notification settings - Fork 176
wip: fix(plugin): enforce strict versioning for static plugins #2278
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
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnosek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2278 +/- ##
==========================================
+ Coverage 77.16% 77.17% +0.01%
==========================================
Files 226 226
Lines 30161 30187 +26
Branches 4611 4611
==========================================
+ Hits 23274 23298 +24
- Misses 6887 6889 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/milestone 0.21.0 |
478bf4b to
6cfa7ba
Compare
dc3a941 to
815dc2d
Compare
You should add |
`extract_plugin_abi.py` parses the output from pahole describing the `plugin_api` struct (with the offsets and sizes of all fields) and generates a `plugin_abi.h` header with static asserts to ensure the ABI is up to date (on x86_64/Linux). `diff_plugin_abi.py` takes two copies of the generated plugin_abi.h files (presumably, one from the repo and a freshly generated one) and raises an error if: * a struct member has been moved/removed without ABI version bump * the ABI version has been increased without breaking changes Note: adding a field at the end of the plugin_api struct does not count as a breaking change. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
The current ABI is arbitrarily chosen as v3 (to match the major API version). Note: when making incompatible ABI changes, this file will prevent the build from succeeding. When you're making ABI changes on purpose, the easiest way is to remove everything but the ABI version `#define` from plugin_abi.h and once everything builds, regenerate plugin_abi.h (see tools/plugin_abi/extract_plugin_abi.py) Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Introduce an explicit ABI version field to plugin_api, as well as a size field. This allows us to explicitly detect incompatible ABIs, but also to detect struct changes within an ABI version. The size field is actually pretty important (maybe more than the actual version field, as long as get_api_version can be easily found), because it's the only way to know how big the plugin-provided struct actually is. With plugins targeting older API versions, we're doing a basically guaranteed out of bounds read otherwise (if the plugin_api struct in the framework is larger than what the plugin exports). Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
a69bd1f to
c062ec7
Compare
|
Moving to next milestone, no need to hurry for the current one. |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh with Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with Provide feedback via https://github.com/falcosecurity/community. /lifecycle stale |
|
any update on this? 🤔 |
|
Stale issues rot after 30d of inactivity. Mark the issue as fresh with Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with Provide feedback via https://github.com/falcosecurity/community. /lifecycle rotten |
|
/remove-lifecycle rotten |
|
/milestone 0.23.0 |
|
Issues go stale after 90d of inactivity. Mark the issue as fresh with Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with Provide feedback via https://github.com/falcosecurity/community. /lifecycle stale |
|
/remove-lifecycle stale |
Statically linked plugins have stricter version requirements, since they rely on the layout of the
plugin_apistruct. So, when loading a statically linked plugin, we enforce the plugin API to be exactly equal (up to the patch level) to the framework API.What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area libsinsp
Does this PR require a change in the driver versions?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: