If a malformed program header has p_filesz > p_memsz, the subtraction underflows.
Introduced guard to validate before zeroing.
Details
Details
- Reviewers
- None
- Group Reviewers
Src Committers Contributor Reviews (src)
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
For this case, I would rather abort the link attempt and treat this as a corrupt file. In fact, several other things break here before we even get to the bzero if filesz > memsz. Rather than this change, I'll be fixing various ELF loaders in the tree to reject files where filesz > memsz.