All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 v2 0/2] ms/um: Set parent death signal for userspace process
@ 2026-10-29 17:04 Eva Kurchatova
  2026-10-29 17:04 ` [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function Eva Kurchatova
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Eva Kurchatova @ 2026-10-29 17:04 UTC (permalink / raw)
  To: khorenko; +Cc: devel

Changes since v2:
- Send commit "ms/um: Add os_set_pdeathsig helper function"
- Improve wording

Link to v1: http://lore.virtuozzo.com/kernel/20261027205112.1316232-1-eva.kurchatova@virtuozzo.com/T/#u

Benjamin Berg (1):
  ms/um: Set parent death signal for userspace process

Tiwei Bie (1):
  ms/um: Add os_set_pdeathsig helper function

 arch/um/include/shared/os.h     | 2 ++
 arch/um/os-Linux/process.c      | 6 ++++++
 arch/um/os-Linux/skas/process.c | 3 +++
 3 files changed, 11 insertions(+)

-- 
2.56.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function
  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
  2026-10-29 17:08   ` 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:30 ` [Devel] [PATCH hci-8.1 v2 0/2] " Konstantin Khorenko
  2 siblings, 1 reply; 6+ messages in thread
From: Eva Kurchatova @ 2026-10-29 17:04 UTC (permalink / raw)
  To: khorenko; +Cc: devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Devel] [PATCH hci-8.1 v2 2/2] ms/um: Set parent death signal for userspace process
  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 ` [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function Eva Kurchatova
@ 2026-10-29 17:04 ` Eva Kurchatova
  2026-10-29 17:08   ` no-reply
  2026-10-29 17:30 ` [Devel] [PATCH hci-8.1 v2 0/2] " Konstantin Khorenko
  2 siblings, 1 reply; 6+ messages in thread
From: Eva Kurchatova @ 2026-10-29 17:04 UTC (permalink / raw)
  To: khorenko; +Cc: devel

From: Benjamin Berg <benjamin.berg@intel.com>

Enable PR_SET_PDEATHSIG so that the UML userspace process will be killed
when the kernel exits unexpectedly.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20240919124511.282088-4-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 801e00d3a1b78b7f71675fae79946ff4aa3ee070)

Rebase note: the userspace process is set up differenly before commit
32e8eaf263d9 ("um: use execveat to create userspace MMs"), whith this
tree lacks, so set parent death signal up in userspace_tramp() rather
than in the stub executable.

https://virtuozzo.atlassian.net/browse/VSTOR-143633
Feature: fix ms/um

Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>
---
 arch/um/os-Linux/skas/process.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
index b6f656bcffb1..cca016b0b29b 100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
@@ -214,6 +214,9 @@ static int userspace_tramp(void *stack)
 				     (unsigned long) stub_segv_handler -
 				     (unsigned long) __syscall_stub_start;
 
+	/* Make sure this process dies if the kernel dies */
+	os_set_pdeathsig();
+
 	ptrace(PTRACE_TRACEME, 0, 0, 0);
 
 	signal(SIGTERM, SIG_DFL);
-- 
2.56.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function
  2026-10-29 17:04 ` [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function Eva Kurchatova
@ 2026-10-29 17:08   ` no-reply
  0 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2026-10-29 17:08 UTC (permalink / raw)
  To: Eva Kurchatova, khorenko; +Cc: devel

> 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>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261029170613.1649335-1-eva.kurchatova@virtuozzo.com?part=1


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Devel] [PATCH hci-8.1 v2 2/2] ms/um: Set parent death signal for userspace process
  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
  0 siblings, 0 replies; 6+ messages in thread
From: no-reply @ 2026-10-29 17:08 UTC (permalink / raw)
  To: khorenko, Eva Kurchatova; +Cc: devel

> From: Benjamin Berg <benjamin.berg@intel.com>
> 
> Enable PR_SET_PDEATHSIG so that the UML userspace process will be killed
> when the kernel exits unexpectedly.
> 
> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
> Link: https://patch.msgid.link/20240919124511.282088-4-benjamin@sipsolutions.net
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> (cherry picked from commit 801e00d3a1b78b7f71675fae79946ff4aa3ee070)
> 
> Rebase note: the userspace process is set up differenly before commit
> 32e8eaf263d9 ("um: use execveat to create userspace MMs"), whith this
> tree lacks, so set parent death signal up in userspace_tramp() rather
> than in the stub executable.
> 
> https://virtuozzo.atlassian.net/browse/VSTOR-143633
> Feature: fix ms/um
> 
> Signed-off-by: Eva Kurchatova <eva.kurchatova@virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261029170613.1649335-1-eva.kurchatova@virtuozzo.com?part=2


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Devel] [PATCH hci-8.1 v2 0/2] ms/um: Set parent death signal for userspace process
  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 ` [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function Eva Kurchatova
  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:30 ` Konstantin Khorenko
  2 siblings, 0 replies; 6+ messages in thread
From: Konstantin Khorenko @ 2026-10-29 17:30 UTC (permalink / raw)
  To: Eva Kurchatova; +Cc: devel

On Thu, 29 Oct 2026 19:04:34 +0200, Eva Kurchatova wrote:
> ms/um: Set parent death signal for userspace process
> 
> Changes since v2:
> - Send commit "ms/um: Add os_set_pdeathsig helper function"
> - Improve wording
> 
> Link to v1: http://lore.virtuozzo.com/kernel/20261027205112.1316232-1-eva.kurchatova@virtuozzo.com/T/#u
> 
> [...]

Applied to branch-rh10-6.12.0-211.52.1.22.x.vz10-ovz, will be released in rh10-6.12.0-211.52.1.22.12.vz10, thanks!

[1/2] ms/um: Add os_set_pdeathsig helper function
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/d7b1b22ee551
[2/2] ms/um: Set parent death signal for userspace process
      https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/18f6dd3a4ff7

-- 
Konstantin Khorenko,
Virtuozzo Linux Kernel Team


_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-29 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Devel] [PATCH hci-8.1 v2 1/2] ms/um: Add os_set_pdeathsig helper function Eva Kurchatova
2026-10-29 17:08   ` 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

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.