From 933a1d8f6240355bf066963f7fa226eefb8f1e25 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 21 Dec 2022 13:22:29 +0100 Subject: S_mach_notify_new_task: Ignore notification of dead tasks In case the new task notification gets late, the task may have terminated already, and thus a dead name gets provided in the notification. We should just ignore this, otherwise the task hashing would get collisions on all such dead tasks ports. --- proc/mgt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'proc/mgt.c') diff --git a/proc/mgt.c b/proc/mgt.c index 38a3a90c..67d74049 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -1365,6 +1365,9 @@ S_mach_notify_new_task (struct port_info *notify, || (kernel_proc != NULL && notify != (struct port_info *) kernel_proc)) return EOPNOTSUPP; + if (task == MACH_PORT_DEAD) + return ESRCH; + parentp = task_find_nocreate (parent); if (! parentp) return ESRCH; -- cgit v1.2.3