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

net: "runtime error: slice bounds out of range" parsing resolv.conf with unknown eight character options #8252

Closed
calmh opened this issue Jun 20, 2014 · 7 comments

Comments

Projects
None yet
5 participants
@calmh
Copy link
Contributor

commented Jun 20, 2014

go version go1.3 darwin/amd64

There's an off by one difference between check and slice index in dnsconfig_unix.go that
causes a crash if there are unrecognized eight character options in /etc/resolv.conf. An
example resolv.conf that triggers this is:

options timeout 2
options attempts 1
search internal
nameserver 10.60.60.151
nameserver 10.60.60.254

(the "options attempts 1" line)

It's possible this is an invalid resolv.conf; we won't be able to parse the options but
should anyway not crash.
@calmh

This comment has been minimized.

Copy link
Contributor Author

commented Jun 20, 2014

Comment 1:

https://golang.org/cl/102470046 contains a test and fix
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jun 20, 2014

Comment 2:

Labels changed: added repo-main, release-go1.3.1.

@gopherbot

This comment has been minimized.

Copy link

commented Jul 3, 2014

Comment 3:

CL https://golang.org/cl/102470046 mentions this issue.
@adg

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2014

Comment 4:

This issue was closed by revision 0a5cb7d.

Status changed to Fixed.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2014

Comment 5:

Trivial change for problem without workaround.
Approved for Go 1.3.1.
@adg

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2014

Comment 6:

This issue was closed by revision 16ce5710133e.

@adg

This comment has been minimized.

Copy link
Contributor

commented Aug 11, 2014

Comment 7:

Applied to release-branch.go1.3.

@calmh calmh added fixed labels Aug 11, 2014

@rsc rsc added this to the Go1.3.1 milestone Apr 14, 2015

@rsc rsc removed the release-go1.3.1 label Apr 14, 2015

adg added a commit that referenced this issue May 11, 2015

[release-branch.go1.3] net: Don't read beyond end of slice when parsi…
…ng resolv.conf options.

««« CL 102470046 / 5207b394de96
net: Don't read beyond end of slice when parsing resolv.conf options.

Fixes #8252.

LGTM=adg
R=ruiu, josharian, adg
CC=golang-codereviews
https://golang.org/cl/102470046

»»»

TBR=rsc
CC=golang-codereviews
https://golang.org/cl/124140043

@golang golang locked and limited conversation to collaborators Jun 25, 2016

wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018

wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.