sync: cherry-pick for release/0.25.x#3001
Conversation
Split execve_x and execveat_x into 4-stage tail call chains with success/failure path separation. Apply __noinline to auxmap__store_exe_args_failure and precompute args_space to replace two-variable range tracking with single-variable comparison. Kernel 7.0 changed BPF verifier state pruning behavior (commits 3cd5c890652b, b2a0aa3a8739, f597664454bd, 179ee84a8911), causing programs already near the 1M instruction limit to exceed BPF_COMPLEXITY_LIMIT_INSNS. These changes reduce instruction count and verifier state complexity to stay within the limit. Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com>
In auxmap__store_exe_args_failure(), when exe_len equals MAX_PROC_ARG_ENV (both are 4096), args_space is 0 but the loop still runs once. push__charbuf advances auxmap->payload_pos for the first arg before the args_len >= args_space check clamps args_len back to 0. Since the rewind block is gated on args_len > 0, payload_pos stays advanced while the stored param length is 0, desynchronizing all subsequent params in the event. Early-return with a zero-length args param when args_space is 0, so the loop never runs and payload_pos is never advanced without a matching length. Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com>
Keep argv collection in the entry program so kernel 7 still sees a smaller verifier unit while older kernels avoid tail-call plus bpf-to-bpf helper restrictions. Restore ptid to ppid in the failure path and bump the driver API version for the extra tail-call stages: libpman now loads three tail-called programs per execve/execveat instead of two, so the userspace<->kernel API contract grows. Signed-off-by: Angelo Puglisi <angelopuglisi86@gmail.com>
The kernel module currently exports euids, egids and loginuids as seen from the task's user namespace: this is inconsistent with the (expected) behaviour implemented by the modern eBPF probe, that exports the ones seen from the init user namespace. Make the kernel module consistent by fixing its code to export the ones seen from the init user namespace. Signed-off-by: Leonardo Di Giovanna <leonardodigiovanna1@gmail.com>
|
@ekoops: The provided milestone is not valid for this repository. Milestones in this repository: [ Use DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/milestone 10.2.0+driver |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, gnosek, irozzo-1A, leogr 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/0.25.x #3001 +/- ##
=================================================
Coverage ? 75.73%
=================================================
Files ? 299
Lines ? 33164
Branches ? 5166
=================================================
Hits ? 25116
Misses ? 8048
Partials ? 0
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:
|
Perf diff from master - unit testsHeap diff from master - unit testsHeap diff from master - scap fileBenchmarks diff from master |
What type of PR is this?
/kind sync
Any specific area of the project related to this PR?
/area drivers
/area driver-kmod
/area driver-modern-bpf
/area libpman
Does this PR require a change in the driver versions?
/version driver-API-version-minor
/version driver-SCHEMA-version-patch
What this PR does / why we need it:
This PR cherry-picks from master the content of the following merged PRs:
This sync prepares the
10.2.0+driverdrivers releaseWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
/milestone 10.2.0+driver
Does this PR introduce a user-facing change?: