summaryrefslogtreecommitdiff
path: root/arch/um/include/shared/skas/mm_id.h
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2025-06-02 15:00:49 +0200
committerJohannes Berg <johannes.berg@intel.com>2025-06-02 15:17:19 +0200
commit8420e08fe3a594b6ffa07705ac270faa2ed452c5 (patch)
tree22b578adabd9ef875fdaf560bd8d6a37eb8309b6 /arch/um/include/shared/skas/mm_id.h
parentb1e1bd2e69430445021394536740352be1b41cd0 (diff)
um: Track userspace children dying in SECCOMP mode
When in seccomp mode, we would hang forever on the futex if a child has died unexpectedly. In contrast, ptrace mode will notice it and kill the corresponding thread when it fails to run it. Fix this issue using a new IRQ that is fired after a SIGCHLD and keeping an (internal) list of all MMs. In the IRQ handler, find the affected MM and set its PID to -1 as well as the futex variable to FUTEX_IN_KERN. This, together with futex returning -EINTR after the signal is sufficient to implement a race-free detection of a child dying. Note that this also enables IRQ handling while starting a userspace process. This should be safe and SECCOMP requires the IRQ in case the process does not come up properly. Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Link: https://patch.msgid.link/20250602130052.545733-5-benjamin@sipsolutions.net Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/include/shared/skas/mm_id.h')
-rw-r--r--arch/um/include/shared/skas/mm_id.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/um/include/shared/skas/mm_id.h b/arch/um/include/shared/skas/mm_id.h
index 140388c282f6..0654c57bb28e 100644
--- a/arch/um/include/shared/skas/mm_id.h
+++ b/arch/um/include/shared/skas/mm_id.h
@@ -14,4 +14,6 @@ struct mm_id {
void __switch_mm(struct mm_id *mm_idp);
+void notify_mm_kill(int pid);
+
#endif