summaryrefslogtreecommitdiff
path: root/proc
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-21 13:22:29 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-21 13:24:50 +0100
commit933a1d8f6240355bf066963f7fa226eefb8f1e25 (patch)
treecc1fcad2fb9b22fff2170af657342604dee6668e /proc
parent18835e7576609524f3613709b579fc90b78bf24f (diff)
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.
Diffstat (limited to 'proc')
-rw-r--r--proc/mgt.c3
1 files changed, 3 insertions, 0 deletions
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;