From f589b48217e6593714e80e2a043fb8fd382acff8 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Thu, 5 Aug 2021 19:25:42 +0300 Subject: libports: Only accept dead-name notifications on notify_port Since this port is never given out to anyone but the kernel, our clients can't spoof a dead-name notification this way. --- libports/notify-dead-name.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libports') diff --git a/libports/notify-dead-name.c b/libports/notify-dead-name.c index f974e331..8d79a631 100644 --- a/libports/notify-dead-name.c +++ b/libports/notify-dead-name.c @@ -25,12 +25,12 @@ error_t ports_do_mach_notify_dead_name (struct port_info *pi, mach_port_t dead_name) { - if (!pi) + if (!ports_port_is_notify (pi)) return EOPNOTSUPP; ports_dead_name (pi, dead_name); /* Drop gratuitous extra reference that the notification creates. */ mach_port_deallocate (mach_task_self (), dead_name); - + return 0; } -- cgit v1.2.3