[lxc-devel] [lxc/master] More pdeathsig fixes

flx42 on Github lxc-bot at linuxcontainers.org
Thu Apr 4 04:41:44 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190403/f3488e1d/attachment.bin>
-------------- next part --------------
From f08a5cc4fc3850ec245a88ce13ace39f77a34ff9 Mon Sep 17 00:00:00 2001
From: Felix Abecassis <fabecassis at nvidia.com>
Date: Wed, 3 Apr 2019 21:09:53 -0700
Subject: [PATCH 1/2] Fix user namespace pdeathsig handling

Signed-off-by: Felix Abecassis <fabecassis at nvidia.com>
---
 src/lxc/start.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index 139f429635..793bf816af 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1190,7 +1190,7 @@ static int do_start(void *data)
 			goto out_warn_father;
 
 		/* set{g,u}id() clears deathsignal */
-		ret = lxc_set_death_signal(SIGKILL, 0);
+		ret = lxc_set_death_signal(SIGKILL, handler->monitor_pid);
 		if (ret < 0) {
 			SYSERROR("Failed to set PR_SET_PDEATHSIG to SIGKILL");
 			goto out_warn_father;

From 97d8f4b77303404b873ffd113e11aa9328b6376d Mon Sep 17 00:00:00 2001
From: Felix Abecassis <fabecassis at nvidia.com>
Date: Wed, 3 Apr 2019 21:12:38 -0700
Subject: [PATCH 2/2] Fix monitor pdeathsig handling

Signed-off-by: Felix Abecassis <fabecassis at nvidia.com>
---
 src/lxc/start.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/start.c b/src/lxc/start.c
index 793bf816af..46a92d3d46 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -1438,7 +1438,7 @@ static int do_start(void *data)
 	}
 
 	if (handler->conf->monitor_signal_pdeath != SIGKILL) {
-		ret = lxc_set_death_signal(handler->conf->monitor_signal_pdeath, 0);
+		ret = lxc_set_death_signal(handler->conf->monitor_signal_pdeath, handler->monitor_pid);
 		if (ret < 0) {
 			SYSERROR("Failed to set PR_SET_PDEATHSIG to %d",
 				 handler->conf->monitor_signal_pdeath);


More information about the lxc-devel mailing list