nova: support dropping caps just locally

without revocation of all subsequent delegations.

Fixes #1950
This commit is contained in:
Alexander Boettcher
2016-04-19 17:48:04 +02:00
committed by Christian Helmuth
parent 0ac1d1774d
commit 77c4510787
12 changed files with 373 additions and 47 deletions

View File

@ -42,15 +42,12 @@ Cap_range *Cap_range::find_by_id(addr_t id)
}
void Cap_range::inc(unsigned id, bool inc_if_one)
void Cap_range::inc(unsigned id)
{
bool failure = false;
{
Lock::Guard guard(_lock);
if (inc_if_one && _cap_array[id] != 1)
return;
if (_cap_array[id] + 1 == 0)
failure = true;
else
@ -78,7 +75,7 @@ void Cap_range::dec(unsigned const id_start, bool revoke, unsigned num_log_2)
}
if (revoke && _cap_array[id] == 1)
Nova::revoke(Nova::Obj_crd(_base + id, 0));
Nova::drop(Nova::Obj_crd(_base + id, 0));
_cap_array[id]--;
}

View File

@ -166,15 +166,6 @@ void Rpc_entrypoint::_activation_entry()
return;
}
/*
* Inhibit removal of capabilities sent as results of client requests.
* This prevents the recursive revocation of NOVA portal caps and,
* therefore, permits clients to use result capabilities after server
* code dropped all references.
*/
for (unsigned i = 0; i < ep._snd_buf.used_caps(); ++i)
ep._snd_buf.cap(i).keep_if_last_reference();
/* dispatch request */
ep._snd_buf.reset();
try { exc = obj->dispatch(opcode, unmarshaller, ep._snd_buf); }