From: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
To: khorenko@virtuozzo.com
Cc: devel@openvz.org
Subject: [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function
Date: Thu, 29 Oct 2026 19:04:35 +0200 [thread overview]
Message-ID: <20261029170613.1649335-2-eva.kurchatova@virtuozzo.com> (raw)
In-Reply-To: <20261029170613.1649335-1-eva.kurchatova@virtuozzo.com>
From: Tiwei Bie <tiwei.btw@antgroup.com>
This helper can be used to set the parent-death signal of the calling
process to SIGKILL to ensure that the process will be killed if the
UML kernel dies unexpectedly without proper cleanup. This helper will
be used in the follow-up patches.
Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com>
Link: https://patch.msgid.link/20241024142828.2612828-2-tiwei.btw@antgroup.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 4e5adbe447db382cc76e05613581f96aef4f91d2)
https://virtuozzo.atlassian.net/browse/VSTOR-143633
Feature: fix ms/um
Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
arch/um/include/shared/os.h | 2 ++
arch/um/os-Linux/process.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h
index 9a039d6f1f74..2ef3bb872b76 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -220,6 +220,8 @@ extern int os_drop_memory(void *addr, int length);
extern int can_drop_memory(void);
extern int os_mincore(void *addr, unsigned long len);
+void os_set_pdeathsig(void);
+
/* execvp.c */
extern int execvp_noalloc(char *buf, const char *file, char *const argv[]);
/* helper.c */
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c
index e52dd37ddadc..d25d709488f2 100644
--- a/arch/um/os-Linux/process.c
+++ b/arch/um/os-Linux/process.c
@@ -12,6 +12,7 @@
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/ptrace.h>
+#include <sys/prctl.h>
#include <sys/wait.h>
#include <asm/unistd.h>
#include <init.h>
@@ -285,3 +286,8 @@ void init_new_thread_signals(void)
set_handler(SIGIO);
signal(SIGWINCH, SIG_IGN);
}
+
+void os_set_pdeathsig(void)
+{
+ prctl(PR_SET_PDEATHSIG, SIGKILL);
+}
--
2.56.0
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
next prev parent reply other threads:[~2026-10-29 17:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 17:04 [Devel] [PATCH hci-8.1 v2 0/2] ms/um: Set parent death signal for userspace process Eva Kurchatova
2026-10-29 17:04 ` Eva Kurchatova [this message]
2026-10-29 17:08 ` [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function no-reply
2026-10-29 17:04 ` [Devel] [PATCH hci-8.1 v2 2/2] ms/um: Set parent death signal for userspace process Eva Kurchatova
2026-10-29 17:08 ` no-reply
2026-10-29 17:30 ` [Devel] [PATCH hci-8.1 v2 0/2] " Konstantin Khorenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261029170613.1649335-2-eva.kurchatova@virtuozzo.com \
--to=eva.kurchatova@virtuozzo.com \
--cc=devel@openvz.org \
--cc=khorenko@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.