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

find_kernel: fix ELF module boundaries #377

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

cagatay-y
Copy link
Contributor

I am not very sure about this one, but I think the function is supposed the return the slice between the start and end addresses in the first module. It looks like the end value for the first module and the maximum end value for all the modules (needed for mapping them) was confused. If my understanding is correct, the caller would still work because the functions it calls determine the length it reads from the returned slice by other means, so the slice being too large does not hurt.

In cases where we want to page a range rather than a certain number of
pages, use map_page to eliminate the need to calculate the page count.
containing_page calls already align the addresses down. As such, we do not need to align the addresses down ourselves.
Instead of checking if it is the first iteration of the loop in every iteration, handle the first iteration of the modules iterator outside the loop.
@cagatay-y cagatay-y marked this pull request as draft October 1, 2024 12:13
@cagatay-y cagatay-y marked this pull request as ready for review October 1, 2024 13:02
@mkroening mkroening self-requested a review October 1, 2024 13:22
@mkroening mkroening self-assigned this Oct 1, 2024
@cagatay-y cagatay-y force-pushed the module-boundaries branch 2 times, most recently from 92a7d3f to a6c7a1d Compare October 3, 2024 10:40
 The end address for all the modules seemed to be confused with the end address for the first module.
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.

2 participants