summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2017-03-03 17:10:53 +0100
committerJustus Winter <justus@gnupg.org>2017-03-03 17:19:10 +0100
commit7845e0f740d104dc712505ab2f8b273a18078fae (patch)
treec34ba48c698526354f2f45596e97c596a87d73fb /boot
parent5ac0c5c8e2e13217aabe7dd6e91ff218d0db6346 (diff)
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.
Diffstat (limited to 'boot')
-rw-r--r--boot/boot.c3
1 files changed, 3 insertions, 0 deletions
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);
}