From 6fa06d960b5ec38867a35dc278ae318ecff1b6c6 Mon Sep 17 00:00:00 2001 From: Haoran Luo Date: Tue, 8 Dec 2020 14:29:04 +0000 Subject: 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 TryBot-Result: Go Bot Reviewed-by: Michael Pratt Reviewed-by: Austin Clements --- src/runtime/os_linux_be64.go | 1 + 1 file changed, 1 insertion(+) (limited to 'src/runtime/os_linux_be64.go') diff --git a/src/runtime/os_linux_be64.go b/src/runtime/os_linux_be64.go index 14fbad5d5f..9860002ee4 100644 --- a/src/runtime/os_linux_be64.go +++ b/src/runtime/os_linux_be64.go @@ -38,6 +38,7 @@ func sigdelset(mask *sigset, i int) { *mask &^= 1 << (uint(i) - 1) } +//go:nosplit func sigfillset(mask *uint64) { *mask = ^uint64(0) } -- cgit v1.3