linux-um archives
 help / color / mirror / Atom feed
From: Florian Fainelli <florian.fainelli@broadcom.com>
To: stable@vger.kernel.org
Cc: Tiwei Bie <tiwei.btw@antgroup.com>,
	Johannes Berg <johannes.berg@intel.com>,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <david@davidgow.net>, Rae Moar <raemoar63@gmail.com>,
	Kees Cook <kees@kernel.org>, Jens Axboe <axboe@kernel.dk>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-um@lists.infradead.org (open list:USER-MODE LINUX (UML)),
	linux-kernel@vger.kernel.org (open list),
	linux-kselftest@vger.kernel.org (open list:KERNEL UNIT TESTING
	FRAMEWORK (KUnit)),
	kunit-dev@googlegroups.com (open list:KERNEL UNIT TESTING
	FRAMEWORK (KUnit)),
	bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH stable 6.12 1/9] um: Add os_set_pdeathsig helper function
Date: Fri, 24 Jul 2026 14:41:11 -0700	[thread overview]
Message-ID: <20260724214119.1066665-2-florian.fainelli@broadcom.com> (raw)
In-Reply-To: <20260724214119.1066665-1-florian.fainelli@broadcom.com>

From: Tiwei Bie <tiwei.btw@antgroup.com>

commit 4e5adbe447db382cc76e05613581f96aef4f91d2 upstream

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>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.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 77a8593f219a..2a0843cc2208 100644
--- a/arch/um/include/shared/os.h
+++ b/arch/um/include/shared/os.h
@@ -219,6 +219,8 @@ extern int os_unmap_memory(void *addr, int len);
 extern int os_drop_memory(void *addr, int length);
 extern int can_drop_memory(void);
 
+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 2686120ab232..4015d3dc3958 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>
@@ -234,3 +235,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.34.1



  reply	other threads:[~2026-07-24 21:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 21:41 [PATCH stable 6.12 0/9] Kunit backports for older systems Florian Fainelli
2026-07-24 21:41 ` Florian Fainelli [this message]
2026-07-24 21:41 ` [PATCH stable 6.12 2/9] um: Set parent death signal for winch thread/process Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 3/9] um: Use os_set_pdeathsig helper in " Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 4/9] um: Set parent-death signal for ubd io thread/process Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 5/9] um: Set parent-death signal for write_sigio thread/process Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 6/9] um: Set parent death signal for userspace process Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 7/9] kunit: tool: Terminate kernel under test on SIGINT Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 8/9] kunit: tool: skip stty when stdin is not a tty Florian Fainelli
2026-07-24 21:41 ` [PATCH stable 6.12 9/9] um: Preserve errno within signal handler Florian Fainelli
2026-07-30 12:38 ` [PATCH stable 6.12 0/9] Kunit backports for older systems Greg KH
2026-07-30 16:07   ` Florian Fainelli
2026-07-31  2:39   ` Sasha Levin
2026-07-31 23:16     ` Florian Fainelli

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=20260724214119.1066665-2-florian.fainelli@broadcom.com \
    --to=florian.fainelli@broadcom.com \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=axboe@kernel.dk \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=brendan.higgins@linux.dev \
    --cc=david@davidgow.net \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kees@kernel.org \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=raemoar63@gmail.com \
    --cc=richard@nod.at \
    --cc=stable@vger.kernel.org \
    --cc=tiwei.btw@antgroup.com \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox