-
Notifications
You must be signed in to change notification settings - Fork 52
Support modules with a lot of sections #280
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
base: master
Are you sure you want to change the base?
Conversation
A module might contain more than 65535 sections. Prepare support for such module files by turning relevant fields into uint32_t. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Read extra fields from section header 0 if needed. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
idx, elf->header.section.count); | ||
return 0; | ||
} | ||
return elf->header.section.offset + | ||
(uint64_t)(idx * elf->header.section.entry_size); | ||
(uint64_t)idx * elf->header.section.entry_size; |
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.
Not sure how easy is for the uint16_t * uint16_t
overflow to trigger, but let's keep this change as separate commit.
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.
Since idx is changed in this PR to a uint32_t and the C standard would therefore use unsigned int
for the result, it would be possible.
Not 100% sure about the second commit but the first one looks solid. @stoeckmann can you address my minor comment and undraft? |
I've kept it as a draft because the linux kernel itself cannot support such modules either (as confirmed in #277). I have used this PR for easier testing/reference to the linked issue. If we want to support possible features of future kernels we could merge this, but right now it's just a possible way of introducing bugs for no practical gain. |
It seems that it's possible to compile modules with more than 0xFF00 sections. This leads to different fields in ELF files used to handle such a large amount of sections.
Parse proper fields if necessary.