]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo: mark C result as written for msan
authorIan Lance Taylor <iant@golang.org>
Wed, 4 Jul 2018 05:10:58 +0000 (22:10 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 5 Jul 2018 05:15:15 +0000 (05:15 +0000)
commite2f8766c30881fbbd97e1e039f5ecc38104f907f
tree2edac01c11a10459f328bcbcb17d6cf23fe5cbcb
parent9e5fe6baf1dfd8ea7ba1456845a7e1f7256eeeaa
cmd/cgo: mark C result as written for msan

Otherwise it is possible that msan will consider the C result to be
partially initialized, which may cause msan to think that the Go stack
is partially uninitialized. The compiler will never mark the stack as
initialized, so without this CL it is possible for stack addresses to
be passed to msanread, which will cause a false positive error from msan.

Fixes #26209

Change-Id: I43a502beefd626eb810ffd8753e269a55dff8248
Reviewed-on: https://go-review.googlesource.com/122196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/cgo/testsanitizers/msan_test.go
misc/cgo/testsanitizers/src/msan6.go [new file with mode: 0644]
src/cmd/cgo/main.go
src/cmd/cgo/out.go