-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
The objfile command internally contains a branch for legacy go binaries. See:
go/src/cmd/internal/objfile/pe.go
Line 115 in 770df2e
if pclntab, err2 = loadPETable(f.pe, "pclntab", "epclntab"); err2 != nil { |
go/src/cmd/internal/objfile/pe.go
Lines 177 to 181 in 770df2e
data, err := sect.Data() | |
if err != nil { | |
return nil, err | |
} | |
return data[ssym.Value:esym.Value], nil |
The epclntab symbol can in some instances point just beyond the .data section. I'm inclined to think this may be an old bug because subtracting the start address of the .data starting virtual address (4096 in this case) brings the value in range of the end of the data section. The binary I am dealing with is go 1.2
Either way, there is zero verification of the symbol values before indexing into the data array, this should be fixed so that a nice error can be ommited rather than panicking unexpectedly. This also involves my old ticket as well: #42954. For binaries such as this one with invalid symbols the tab can be trivially found with a signature scan. This would be an even better fallback behavior than printing an 'error malformed pclntab symbols'.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status