From 7845e0f740d104dc712505ab2f8b273a18078fae Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Fri, 3 Mar 2017 17:10:53 +0100 Subject: boot: Fix failing device lookups in unprivileged mode. Previously, EMACH_SEND_INVALID_DEST was returned. This had devastating consequences on the translator linkage of storeio translators. When accessed, the parent translator tried to start the translator over and over again, spawning tasks until the system runs out of resources. * boot/boot.c (ds_device_open): Return the correct error when trying to open a non-existent device in unprivileged mode. --- boot/boot.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'boot') diff --git a/boot/boot.c b/boot/boot.c index 78bd1838..c69c89ac 100644 --- a/boot/boot.c +++ b/boot/boot.c @@ -938,6 +938,9 @@ ds_device_open (mach_port_t master_port, return err; } + if (! privileged) + return D_NO_SUCH_DEVICE; + *devicetype = MACH_MSG_TYPE_MOVE_SEND; return device_open (master_device_port, mode, name, device); } -- cgit v1.2.3