From 941a6d0c054d865b151c6a549633b8eeb2b0c94f Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 30 Apr 2025 18:19:16 +0200 Subject: [PATCH] pkg/signal: ignore SIGTOP for signal proxy It makes no sense to forward it, SIGSTOP cannot be handled by userspace (like SIGKILL) and it didn't do anything before so this just makes it more explicit. Signed-off-by: Paul Holzinger --- pkg/signal/signal_linux.go | 8 +++++++- pkg/signal/signal_linux_mipsx.go | 8 +++++++- pkg/signal/signal_unix.go | 8 +++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/pkg/signal/signal_linux.go b/pkg/signal/signal_linux.go index 0df442b93f..b0f3824979 100644 --- a/pkg/signal/signal_linux.go +++ b/pkg/signal/signal_linux.go @@ -94,5 +94,11 @@ func isSignalIgnoredBySigProxy(s syscall.Signal) bool { // Ignore SIGCHLD and SIGPIPE - these are most likely intended for the podman command itself. // SIGURG was added because of golang 1.14 and its preemptive changes causing more signals to "show up". // https://github.com/containers/podman/issues/5483 - return s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG + // SIGSTOP cannot be ignored/forwarded by userspace. + switch s { + case syscall.SIGCHLD, syscall.SIGPIPE, syscall.SIGURG, syscall.SIGSTOP: + return true + default: + return false + } } diff --git a/pkg/signal/signal_linux_mipsx.go b/pkg/signal/signal_linux_mipsx.go index 852bdf3b39..77492d57d0 100644 --- a/pkg/signal/signal_linux_mipsx.go +++ b/pkg/signal/signal_linux_mipsx.go @@ -94,5 +94,11 @@ func isSignalIgnoredBySigProxy(s syscall.Signal) bool { // Ignore SIGCHLD and SIGPIPE - these are most likely intended for the podman command itself. // SIGURG was added because of golang 1.14 and its preemptive changes causing more signals to "show up". // https://github.com/containers/podman/issues/5483 - return s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG + // SIGSTOP cannot be ignored/forwarded by userspace. + switch s { + case syscall.SIGCHLD, syscall.SIGPIPE, syscall.SIGURG, syscall.SIGSTOP: + return true + default: + return false + } } diff --git a/pkg/signal/signal_unix.go b/pkg/signal/signal_unix.go index d5d22268ab..88b0a55c04 100644 --- a/pkg/signal/signal_unix.go +++ b/pkg/signal/signal_unix.go @@ -92,5 +92,11 @@ func isSignalIgnoredBySigProxy(s syscall.Signal) bool { // Ignore SIGCHLD and SIGPIPE - these are most likely intended for the podman command itself. // SIGURG was added because of golang 1.14 and its preemptive changes causing more signals to "show up". // https://github.com/containers/podman/issues/5483 - return s == syscall.SIGCHLD || s == syscall.SIGPIPE || s == syscall.SIGURG + // SIGSTOP cannot be ignored/forwarded by userspace. + switch s { + case syscall.SIGCHLD, syscall.SIGPIPE, syscall.SIGURG, syscall.SIGSTOP: + return true + default: + return false + } }