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

syscall: ParseNetlinkMessage does not check boundaries before slice reference #16681

Closed
david415 opened this issue Aug 12, 2016 · 1 comment
Closed

Comments

@david415
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go-1.6
  2. What operating system and processor architecture are you using (go env)?
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/user/gopath"
    GORACE=""
    GOROOT="/usr/lib/go-1.6"
    GOTOOLDIR="/usr/lib/go-1.6/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"
  3. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.

I've written a complete description of how I exercise golang's syscall module's netlink message parsing bug here:
subgraph/go-nfnetlink#1

The problem is that the slice boundaries are not checked to make sure they do not extend past the end of the slice, here:

b = b[dlen:]

  1. What did you expect to see?

Bounds checking and a proper error, returned.

  1. What did you see instead?

I saw buggy network parsing code.

@gopherbot
Copy link

CL https://golang.org/cl/26990 mentions this issue.

@quentinmit quentinmit changed the title syscall's ParseNetlinkMessage does not check boundaries before slice reference syscall: ParseNetlinkMessage does not check boundaries before slice reference Aug 26, 2016
@quentinmit quentinmit added this to the Go1.8 milestone Aug 26, 2016
@bradfitz bradfitz modified the milestones: Go1.8Maybe, Go1.8 Sep 9, 2016
david415 added a commit to david415/go that referenced this issue Sep 11, 2016
Fixes golang#16681

Change-Id: I6ff7ec81fe48ab06be3aae5b7ff92e9dc70960c3
david415 added a commit to david415/go that referenced this issue Sep 12, 2016
Fixes golang#16681

Change-Id: I6ff7ec81fe48ab06be3aae5b7ff92e9dc70960c3
@mikioh mikioh removed their assignment Sep 14, 2016
@golang golang locked and limited conversation to collaborators Sep 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants