Upstream contribution · morluto/rea
rea · Honor the declared ELF header boundary in rea
Problem
rea checked table offsets against the minimum header size for the ELF class. An ELF file with an extended declared header could point a program or section table back into those header bytes and still be admitted.
Engineering response
Compare each populated table's offset with the validated declared header size. Preserve acceptance when a table starts at or beyond the header boundary.
Evidence and scope
The pull request reports four regressions failing on the original code and all 19 tests in the declared-range suite passing afterward. Fixtures cover ELF32, ELF64 and both byte orders.