Skip to content
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

debug/elf: slice out of bounds in DynValue #64446

Closed
catenacyber opened this issue Nov 29, 2023 · 2 comments
Closed

debug/elf: slice out of bounds in DynValue #64446

catenacyber opened this issue Nov 29, 2023 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@catenacyber
Copy link
Contributor

Go version

go version go1.21.0 linux/amd64

What operating system and processor architecture are you using (go env)?

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/root/.go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/root/.go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.0'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='clang'
CXX='clang++'
CGO_ENABLED='1'
GOMOD='/src/ngolo-fuzzing/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3715343815=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Run https://go.dev/play/p/tzNXO9vLH62

Found by ngolo-fuzzing https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=64344

What did you expect to see?

Hello world

What did you see instead?

panic: runtime error: slice bounds out of range [:4] with capacity 2

goroutine 1 [running]:
debug/elf.(*File).DynValue(0xc000134000, 0x0)
	/usr/local/go-faketime/src/debug/elf/file.go:1657 +0x365
main.main()
	/tmp/sandbox2925716336/prog.go:13 +0x136

Program exited.
@gopherbot
Copy link

Change https://go.dev/cl/545835 mentions this issue: debug/elf: return error in DynValue for invalid dynamic section size

@dmitshur dmitshur added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. FixPending Issues that have a fix which has not yet been reviewed or submitted. labels Nov 29, 2023
@dmitshur dmitshur added this to the Backlog milestone Nov 29, 2023
@dmitshur
Copy link
Contributor

CC @golang/compiler.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Nov 29, 2023
@dmitshur dmitshur modified the milestones: Backlog, Go1.22 Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FixPending Issues that have a fix which has not yet been reviewed or submitted. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants