forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewriter: Fix tracking of pointers with several indirections
The rewriter tracks, with nb_derefs, the number of indirections of external pointers, to rewrite only the appropriate dereference into a call to bpf_probe_read. In ProbeChecker, however, nb_derefs has a different meaning: it counts the number of dereferences encountered. This difference resulted in an error when ProbeChecker is traversing the right-hand side of an assignment. This commit fixes the error and adds tests for the two cases of assignments: when the right-hand side is an external pointer with several indirection levels and when it is a call to a function returning an external pointer with several indirection levels. This commit also changes ProbeSetter and assignsExtPtr to count dereferences instead of addrof in an effort to use nb_derefs more consistently across the code to mean "number of dereferences needed to get to the external pointer". Signed-off-by: Paul Chaignon <[email protected]>
- Loading branch information
1 parent
d796285
commit 1a780e9
Showing
2 changed files
with
54 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters