]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
um: Set parent death signal for userspace process
authorBenjamin Berg <benjamin.berg@intel.com>
Thu, 19 Sep 2024 12:45:04 +0000 (14:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 10 Oct 2024 11:37:21 +0000 (13:37 +0200)
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>
arch/um/kernel/skas/stub_exe.c

index bc6ba2e4d8054d6ac7fc131e0400d9323429700e..04f75c577f1a08d7880d376c7b270517c2079f52 100644 (file)
@@ -32,6 +32,9 @@ noinline static void real_init(void)
        /* set a nice name */
        stub_syscall2(__NR_prctl, PR_SET_NAME, (unsigned long)"uml-userspace");
 
+       /* Make sure this process dies if the kernel dies */
+       stub_syscall2(__NR_prctl, PR_SET_PDEATHSIG, SIGKILL);
+
        /* read information from STDIN and close it */
        res = stub_syscall3(__NR_read, 0,
                            (unsigned long)&init_data, sizeof(init_data));