diff options
author | Haoran Luo <haoran.luo@chaitin.com> | 2020-12-08 14:29:04 +0000 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2020-12-09 03:01:58 +0000 |
commit | 6fa06d960b5ec38867a35dc278ae318ecff1b6c6 (patch) | |
tree | fca89816eb6d8840f7b501dc4c41ea2821ab4806 /src/runtime/os_linux_mipsx.go | |
parent | ae9b442df2436b3d65ef765572681bf9aacdfbbb (diff) | |
download | go-6fa06d960b5ec38867a35dc278ae318ecff1b6c6.tar.gz go-6fa06d960b5ec38867a35dc278ae318ecff1b6c6.zip |
runtime: prevent stack growth after fork in runtime.sigfillset
This fixes the unexpected growth of stack in child process, which
is caused by stack checking code in runtime.sigfillset called from
runtime.sigset while clearing the signal handlers in child process.
The redundant stack checking code is generated due to missing
'//go:nosplit' directive that should be annotated for
runtime.sigfillset.
Fixes #43066
Updates #21314
Change-Id: I9483a962a4b0747074313991841e2440ee32198c
Reviewed-on: https://go-review.googlesource.com/c/go/+/276173
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/os_linux_mipsx.go')
-rw-r--r-- | src/runtime/os_linux_mipsx.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/os_linux_mipsx.go b/src/runtime/os_linux_mipsx.go index 87962ed982..00fb02e4bf 100644 --- a/src/runtime/os_linux_mipsx.go +++ b/src/runtime/os_linux_mipsx.go @@ -42,6 +42,7 @@ func sigdelset(mask *sigset, i int) { (*mask)[(i-1)/32] &^= 1 << ((uint32(i) - 1) & 31) } +//go:nosplit func sigfillset(mask *[4]uint32) { (*mask)[0], (*mask)[1], (*mask)[2], (*mask)[3] = ^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0) } |