-
Notifications
You must be signed in to change notification settings - Fork 619
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
Pass text segment info to GetBase to handle Linux kernel ASLR case. #299
Merged
Conversation
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
When pprof symbolizes kernel addresses in vmlinux binary for a profile converted using https://github.com/google/perf_data_converter, the addresses need to be adjusted if kernel ASLR is in effect. So far the call to GetBase did not pass text segment info to GetBase which shortcircuited the code to merely return zero adjustment. This change fixes the call to GetBase to address that. The added test case is a simulation of what happens with vmlinux, but it should be pretty close. Including a vmlinux file into the test data does not appear practical due to the binary size. I verified that the test failed before the fix and passes after. Note that the fixed issue is specific to the kernel ASLR as user-mode ASRL-enabled binaries (i.e. built with -pie / -fpie) have ET_DYN type which takes a different code path in GetBase which did not have issues before this fix in practice.
Codecov Report
@@ Coverage Diff @@
## master #299 +/- ##
==========================================
- Coverage 65.85% 65.81% -0.04%
==========================================
Files 36 36
Lines 7388 7395 +7
==========================================
+ Hits 4865 4867 +2
- Misses 2128 2133 +5
Partials 395 395
Continue to review full report at Codecov.
|
rauls5382
approved these changes
Jan 29, 2018
lannadorai
pushed a commit
to lannadorai/pprof
that referenced
this pull request
Feb 13, 2018
…oogle#299) When pprof symbolizes kernel addresses in vmlinux binary for a profile converted using https://github.com/google/perf_data_converter, the addresses need to be adjusted if kernel ASLR is in effect. So far the call to GetBase did not pass text segment info to GetBase which shortcircuited the code to merely return zero adjustment. This change fixes the call to GetBase to address that. The added test case is a simulation of what happens with vmlinux, but it should be pretty close. Including a vmlinux file into the test data does not appear practical due to the binary size. I verified that the test failed before the fix and passes after. Note that the fixed issue is specific to the kernel ASLR as user-mode ASRL-enabled binaries (i.e. built with -pie / -fpie) have ET_DYN type which takes a different code path in GetBase which did not have issues before this fix in practice.
gmarin13
pushed a commit
to gmarin13/pprof
that referenced
this pull request
Dec 17, 2020
…oogle#299) When pprof symbolizes kernel addresses in vmlinux binary for a profile converted using https://github.com/google/perf_data_converter, the addresses need to be adjusted if kernel ASLR is in effect. So far the call to GetBase did not pass text segment info to GetBase which shortcircuited the code to merely return zero adjustment. This change fixes the call to GetBase to address that. The added test case is a simulation of what happens with vmlinux, but it should be pretty close. Including a vmlinux file into the test data does not appear practical due to the binary size. I verified that the test failed before the fix and passes after. Note that the fixed issue is specific to the kernel ASLR as user-mode ASRL-enabled binaries (i.e. built with -pie / -fpie) have ET_DYN type which takes a different code path in GetBase which did not have issues before this fix in practice.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When pprof symbolizes kernel addresses in vmlinux binary for a profile
converted using https://github.com/google/perf_data_converter, the
addresses need to be adjusted if kernel ASLR is in effect. So far the
call to GetBase did not pass text segment info to GetBase which
shortcircuited the code to merely return zero adjustment. This change
fixes the call to GetBase to address that.
The added test case is an approximation of what happens with vmlinux,
but it should be pretty close. Including a vmlinux file into the test data
does not appear practical due to the binary size. I verified that the test
failed before the fix and passes after.
Note that the fixed issue is specific to the kernel ASLR as user-mode
ASRL-enabled binaries (i.e. built with -pie / -fpie) have ET_DYN type
which takes a different code path in GetBase which did not have issues
before this fix in practice.