From a53295be9d4bbf996a3e6d8d85d88fc0da03c8ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 6 Feb 2025 22:47:04 +0100 Subject: [PATCH] Ignore SIGPIPE in qrexec-fork-server too The process_io() (or more precisely - write_stdin() and write_all()) function relies on write() reporting errors "normally" (negative return value + errno), it is not prepared to handle SIGPIPE signal. If service exits, SIGPIPE sent to the qrexec-fork-server worker process would kill it. The main qrexec-agent process correctly has SIGPIPE handler set to SIG_IGN, but this was missing in qrexec-fork-server. Add it there too. This was found when debugging qrexec performance tests, but looks also similar to this issue: Fixes QubesOS/qubes-issues#5749 --- agent/qrexec-fork-server.c | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/qrexec-fork-server.c b/agent/qrexec-fork-server.c index 34bc1fa4..3ee5c124 100644 --- a/agent/qrexec-fork-server.c +++ b/agent/qrexec-fork-server.c @@ -138,6 +138,7 @@ int main(int argc, char **argv) { exit(0); } signal(SIGCHLD, SIG_IGN); + signal(SIGPIPE, SIG_IGN); register_exec_func(do_exec); while (1) {