Repository navigation
fix(driver/bpf): probe compilation fixes - #22
Conversation
|
Superseedes #5 |
e0dcd83 to
26d095b
Compare
8d73f6e to
26d095b
Compare
eb3f927 to
0dbd80e
Compare
0a33971 to
411f1c9
Compare
Signed-off-by: Lorenzo Fontana <lo@linux.com>
Signed-off-by: Lorenzo Fontana <lo@linux.com>
411f1c9 to
d51af2c
Compare
gnosek
left a comment
There was a problem hiding this comment.
Way less magic, I like it :) Any chance we can #define memset __builtin_bpf_memset (and same thing for memcpy) instead of changing every single call site? This would make it easier to converge to a single filler implementation shared across all engines at some point in time
|
I knew you would've liked it now @gnosek - thanks for the patience :) I tried to do as suggested but it leads to strange behaviors on some compilers and I went this route after. :( |
|
Maybe something like this would work? I feel like having to use the __builtin variants will be error-prone and easy to forget. BTW, do we need the __bpf_builtin_memset wrapper? Wouldn't just __builtin_memset work? BTW2, what "some compilers"? Is there anything else on the table except for various clang versions? |
d51af2c to
563083b
Compare
… and memset Reported-By: Luca Montechiesi <lucamontechiesi@gmail.com> Co-Authored-By: Grzegorz Nosek <grzegorz.nosek@sysdig.com> Signed-off-by: Lorenzo Fontana <lo@linux.com>
This is to make sure that in the subsequent conditions len is treated as a scalar rather than a pointer to map value internally. Signed-off-by: Lorenzo Fontana <lo@linux.com>
…ctx.curoff before using it in conditions. This is to make sure the verifier addresses the comparison operations to the scalar value instead of the map ptr Signed-off-by: Lorenzo Fontana <lo@linux.com>
563083b to
affe7bf
Compare
|
@gnosek you are right, my bad I was not changing all the occurrences when I tried and thought it was a compiler's issue. Pushed a fix and added you as a co-author. |
|
LGTM label has been added. DetailsGit tree hash: 688628b1ee969ae14ffe4d25ec9468006e62e2a6 |
leodido
left a comment
There was a problem hiding this comment.
Reviewed this in person so many times 😃
Great job as usual.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnosek, leodido 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 |
Signed-off-by: Lorenzo Fontana lo@linux.com
What type of PR is this?
/kind bug
Any specific area of the project related to this PR?
/area driver-ebpf
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #4
This is another attempt to fix the issue reported by many users on Falco where you can't have a working BPF probe when compiling with Clang >= 10.0.0
Systems where to test before merging
In particular, we want to make sure the probe still works under systems where it was working before the changes made here.
For faster iteration with newer kernels I created a bpf-harness test suite for our probe. You can find it here https://github.com/fntlnz/bpf-harness
Special notes for your reviewer:
If you can, please test this under your environment and report.
Does this PR introduce a user-facing change?: