summaryrefslogtreecommitdiff
path: root/viengoos/cap-lookup.c
diff options
context:
space:
mode:
authorneal <neal>2008-05-28 14:14:01 +0000
committerneal <neal>2008-05-28 14:14:01 +0000
commit8cb9c4b17b5b4069157547bd80a98882aa1f4a7d (patch)
treec1f3d8fa6b3694ec0d7b5f184b56ff049e8d4f62 /viengoos/cap-lookup.c
parenta67826343a0c64d67fe19f98f0cc2d67e7cc6bdc (diff)
2008-05-28 Neal H. Walfield <neal@gnu.org>
* cap-lookup.c (lookup): Don't update WRITABLE if the designated capability's type is strong but the requested type weak. Consider the designated capability's type incompatible with the requested type if the former is weak and the latter strong.
Diffstat (limited to 'viengoos/cap-lookup.c')
-rw-r--r--viengoos/cap-lookup.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/viengoos/cap-lookup.c b/viengoos/cap-lookup.c
index 84b4438..9b84a8a 100644
--- a/viengoos/cap-lookup.c
+++ b/viengoos/cap-lookup.c
@@ -137,7 +137,7 @@ lookup (activity_t activity,
int guard = extract_bits64_inv (addr, remaining - 1, gdepth);
if (CAP_GUARD (root) != guard)
{
- debug (1, "Translating " ADDR_FMT ": guard 0x%llx/%d does "
+ debug (5, "Translating " ADDR_FMT ": guard 0x%llx/%d does "
"not match 0x%llx's bits %d-%d => 0x%x",
ADDR_PRINTF (address),
CAP_GUARD (root), CAP_GUARD_BITS (root), addr,
@@ -259,17 +259,14 @@ lookup (activity_t activity,
}
assert (remaining == 0);
- if (root->type != type)
- /* Types don't match. They may, however, be compatible. */
+ if (type != -1 && type != root->type)
+ /* Types don't match. */
{
- if (cap_types_compatible (root->type, type))
- /* Type are compatible. We just need to downgrade the
- rights. */
- {
- if (mode == want_object)
- w = false;
- }
- else if (type != -1)
+ if (cap_type_strengthen (type) == root->type)
+ /* The capability just provides more strength than
+ requested. That's fine. */
+ ;
+ else
/* Incompatible types. */
{
do_debug (4)