This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
src/python: fix filtering by containers when kfunc are supported #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
get_mntns_id() has to access current_task->nsproxy->mnt_ns->ns.inum to
get the mount namespace id. Before this commit, that line was written in
C natural syntax and we're relying on the BCC rewriter to transform that
to valid eBPF code by emitting some bpf_probe_read calls.
This support was not working when using opensnoop in systems supporting
kfuncs because in this case the BCC rewriter doesn't transform that line
and the verifier claims about an invalid memory access:
7: (85) call bpf_get_current_task#35
; return current_task->nsproxy->mnt_ns->ns.inum;
8: (79) r1 = *(u64 *)(r0 +2896)
R0 invalid mem access 'inv'
This commit fixes that by explicitly using bpf_probe_kernel_read()
instead of the C natural syntax.
It's not yet 100% clear that this is the best solution to that problem. I've asked for some more information about that error but I have received no response yet. I'm proposing a local fix to our fork to solve inspektor-gadget/inspektor-gadget#244, once we totally understand what's going on I'll propose a fix upstream.