Skip to content

Commit b9e051e

Browse files
runtime: ignore signal 33 == SIGSETXID on GNU/Linux
When a cgo program calls setuid, setgid, etc., the GNU/Linux pthread library sends signal SIGSETXID to each thread to tell it to update its UID info. If Go is permitted to intercept the default SIGSETXID signal handler, the program will hang. This patch tells the runtime package to not try to intercept SIGSETXID on GNU/Linux. This will be odd if a Go program wants to try to use that signal, but it means that cgo programs that call setuid, etc., won't hang. Fixes #3871. R=rsc, r, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/6455050
1 parent a7c74d5 commit b9e051e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pkg/runtime/signals_linux.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ SigTab runtime·sigtab[] = {
4242
/* 30 */ N, "SIGPWR: power failure restart",
4343
/* 31 */ N, "SIGSYS: bad system call",
4444
/* 32 */ N, "signal 32",
45-
/* 33 */ N, "signal 33",
45+
/* 33 */ 0, "signal 33", /* SIGSETXID; see issue 3871 */
4646
/* 34 */ N, "signal 34",
4747
/* 35 */ N, "signal 35",
4848
/* 36 */ N, "signal 36",

0 commit comments

Comments
 (0)