-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Fix #1796 and skip probe rewriter for bpf_probe_read #1812
Conversation
// return TCP_SKB_CB(skb)->tcp_gso_size; | ||
u16 val = 0; | ||
bpf_probe_read(&val, sizeof(val), &(TCP_SKB_CB(skb)->tcp_gso_size)); | ||
return val + skb->protocol; |
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.
Without this pull request, this second test fails because the AST traversal is stopped after meeting the bpf_probe_read
call, even though a rewrite is needed for the later expression skb->protocol
.
I don't understand the Jenkins' failures. The tests passed locally (Ubuntu 16.04 and 17.10), and they're passing for the Fedora builds... |
The function Currently, we already track LLVM major numbers in the cmake file. We can also track minor number, and guard reference of What do you think? |
I agree, though here, we can actually implement the same behavior without |
0f86ff3
to
6048c00
Compare
20fb64c stops the whole AST traversal if it meets a bpf_probe_read call. I think the original intent was to simply not rewrite the third argument, so this commit fixes it by remembering the third argument on bpf_probe_read call traversals and overriding TraverseStmt to skip the traversal of that argument when we meet it later.
6048c00
to
c289d92
Compare
LGTM. Thanks! |
20fb64c stops the whole AST traversal if it meets a bpf_probe_read call. I think the original intent was to simply not rewrite the third argument, so this commit fixes it by remembering the third argument on bpf_probe_read call traversals and overriding TraverseStmt to skip the traversal of that argument when we meet it later.
20fb64c stops the whole AST traversal if it meets a bpf_probe_read call. I think the original intent was to simply not rewrite the third argument, so this commit fixes it by remembering the third argument on bpf_probe_read call traversals and overriding TraverseStmt to skip the traversal of that argument when we meet it later.
#1796 stops the whole AST traversal if it meets a
bpf_probe_read
call. I think the original intent was to simply not rewrite the third argument, so this commit fixes it by remembering the third argument onbpf_probe_read
call traversals and overridingdataTraverseStmtPre
to skip the traversal of thatargument when we meet it later.
/cc @yonghong-song