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.
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
new(bpf-driver): Introduce
bpf_probe_read_user
andbpf_probe_read_kernel
variants #809new(bpf-driver): Introduce
bpf_probe_read_user
andbpf_probe_read_kernel
variants #809Changes from all commits
6f15920
94d0521
96479fc
e2ac1c3
92fc0a2
82d6db5
2ae0e39
6ceb32a
4369ec0
514e634
a3bfd5b
278fa98
064b63a
8a7bea3
aa731a8
5406c3b
5281cb9
70e2076
1ac9d6e
d14c702
d909034
e72d25a
93592b1
843b2e2
28650fd
1c75bb2
9b25675
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pass param_info->type to __bpf_val_to_ring, so we should be able to call param_type_to_mem in there and keep the signature unchanged, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a version with unchanged signature. The problem here is that
param_type_to_mem
makes the decision that forPT_CHARBUF
andPT_BYTEBUF
user space memory is being copied. Unfortunately, this does not work in all cases.Here are some places where for char/byte buffers are copied from kernel space (either from kernel structures or already copied into the scratch area):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, so how about we
(or do the equivalent
static inline
) and use__bpf_val_to_ring_with_explicit_mem
in the few spots where the default guess is wrong?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gnosek ,
let me think a bit about to have an explicit mem version for
__bpf_val_to_ring
.This would at least reduce those 7 occurrences where
USER
has to be specified directly.