From d25e7f30693b4c72b2fadd0503f65cdd0cac53b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Graber?= Date: Mon, 16 Dec 2024 14:25:14 -0500 Subject: [PATCH] lxc.init: Ignore user signals coming from inside the contianer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- src/lxc/initutils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lxc/initutils.c b/src/lxc/initutils.c index 1cc1e695b..86b031c28 100644 --- a/src/lxc/initutils.c +++ b/src/lxc/initutils.c @@ -427,6 +427,11 @@ static sig_atomic_t was_interrupted; static void interrupt_handler(int sig, siginfo_t *info, void *context) { + // Only forward signals if they didn't originate from our own PID + // namespace and if no other signal is already being processed. + if (info->si_code == SI_USER && info->si_pid > 1) + return; + if (!was_interrupted) was_interrupted = sig; } -- 2.47.2