debug/elf: Opening file causes runtime error with certain invalid ELF files #53626
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Reproducible on all OS / archs
What did you do?
I created a minimal ELF file and modified the last section header of that ELF file to have size 0xFFFFFFFFFFFFFFFF.
Then, I called
elf.NewFile(...)
with that ELF file.https://go.dev/play/p/IKMGvTZsOuh
What did you expect to see?
The ELF parser should return an error since the section size is incorrect.
What did you see instead?
The ELF parser allocates an block of RAM equal to the section size, which causes a runtime error:
The text was updated successfully, but these errors were encountered: