]> Cypherpunks repositories - gostls13.git/commit
runtime, syscall: add calls to asan functions
authorfanzha02 <fannie.zhang@arm.com>
Tue, 5 Jan 2021 09:52:43 +0000 (17:52 +0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 2 Nov 2021 05:35:11 +0000 (05:35 +0000)
commit6f327f7b889b81549d551ce6963067267578bd70
tree8a54f62ac50b787f86ad24892e32e854fd57f171
parent6f1e9a9c21aec8531db40dbf61ad10fe77d7bee5
runtime, syscall: add calls to asan functions

Add explicit address sanitizer instrumentation to the runtime and
syscall packages. The compiler does not instrument the runtime
package. It does instrument the syscall package, but we need to add
a couple of cases that it can't see.

Refer to the implementation of the asan malloc runtime library,
this patch also allocates extra memory as the redzone, around the
returned memory region, and marks the redzone as unaddressable to
detect the overflows or underflows.

Updates #44853.

Change-Id: I2753d1cc1296935a66bf521e31ce91e35fcdf798
Reviewed-on: https://go-review.googlesource.com/c/go/+/298614
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: fannie zhang <Fannie.Zhang@arm.com>
18 files changed:
src/runtime/cgo_sigaction.go
src/runtime/iface.go
src/runtime/malloc.go
src/runtime/map.go
src/runtime/mbarrier.go
src/runtime/mgcsweep.go
src/runtime/mheap.go
src/runtime/mprof.go
src/runtime/proc.go
src/runtime/select.go
src/runtime/slice.go
src/runtime/stack.go
src/runtime/string.go
src/runtime/traceback.go
src/syscall/asan.go [new file with mode: 0644]
src/syscall/asan0.go [new file with mode: 0644]
src/syscall/syscall_unix.go
src/syscall/syscall_windows.go