mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
core: Handle disappearing managed dataspaces
This patch adds the consideration of suddenly disappearing managed dataspaces in the 'Rm_session_component::reverse_lookup' function. Previously, this case resulted in a seamingly valid translation. Fixes #701
This commit is contained in:
parent
ae1985bde2
commit
2bbe840597
@ -723,16 +723,19 @@ bool Rm_session_component::reverse_lookup(addr_t dst_base,
|
||||
/* constrain source fault area by the source dataspace dimensions */
|
||||
src_fault_area->constrain(src_base, (*src_dataspace)->size());
|
||||
|
||||
bool lookup = src_fault_area->valid() && dst_fault_area->valid();
|
||||
|
||||
if (!lookup)
|
||||
return lookup;
|
||||
if (!src_fault_area->valid() || !dst_fault_area->valid())
|
||||
return false;
|
||||
|
||||
/* lookup and lock nested dataspace if required */
|
||||
Native_capability session_cap = (*src_dataspace)->sub_rm_session();
|
||||
*sub_rm_session = dynamic_cast<Rm_session_component *>(_session_ep->lookup_and_lock(session_cap));
|
||||
if (session_cap.valid()) {
|
||||
*sub_rm_session = dynamic_cast<Rm_session_component *>(_session_ep->lookup_and_lock(session_cap));
|
||||
return (*sub_rm_session != 0);
|
||||
}
|
||||
|
||||
return lookup;
|
||||
/* loop refer to leaf */
|
||||
*sub_rm_session = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user