Skip to content
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

Add logic for reading KASLR offset #951

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

d-e-s-o
Copy link
Collaborator

@d-e-s-o d-e-s-o commented Dec 30, 2024

In order to (eventually...) support normalization of kernel addresses, we need to take into account whether the running kernel has address space layout randomization enabled. If that is the case, we will need to incorporate the randomization offset in the normalization process. This change introduces the necessary logic for reading said offset, so that it can be used down the line.
This change builds on all the infrastructure we added for making the ELF parser optionally work with using regular I/O APIs instead of relying on memory mapping.

Refs: #950

@d-e-s-o d-e-s-o requested a review from anakryiko December 30, 2024 19:27
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

Attention: Patch coverage is 85.82677% with 18 lines in your changes missing coverage. Please review.

Project coverage is 94.37%. Comparing base (fb567a3) to head (2c0f95e).

Files with missing lines Patch % Lines
src/normalize/kernel.rs 79.54% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
- Coverage   94.47%   94.37%   -0.11%     
==========================================
  Files          57       58       +1     
  Lines       10644    10770     +126     
==========================================
+ Hits        10056    10164     +108     
- Misses        588      606      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@d-e-s-o d-e-s-o force-pushed the topic/kaslr branch 3 times, most recently from 866e604 to cf78df4 Compare December 31, 2024 00:30
@danielocfb danielocfb force-pushed the topic/kaslr branch 2 times, most recently from 12d9352 to a87768d Compare January 2, 2025 20:40
In order to (eventually...) support normalization of kernel addresses,
we need to take into account whether the running kernel has address
space layout randomization enabled. If that is the case, we will need to
incorporate the randomization offset in the normalization process. This
change introduces the necessary logic for reading said offset, so that
it can be used down the line.
This change builds on all the infrastructure we added for making the ELF
parser optionally work with using regular I/O APIs instead of relying on
memory mapping.

Refs: libbpf#950

Signed-off-by: Daniel Müller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant