diff --git a/repos/base/src/core/include/pd_root.h b/repos/base/src/core/include/pd_root.h index e5655f11c8..5bc6ec5933 100644 --- a/repos/base/src/core/include/pd_root.h +++ b/repos/base/src/core/include/pd_root.h @@ -36,14 +36,22 @@ class Genode::Pd_root : public Genode::Root_component node. Otherwise, for PD sessions initiated by a subsystem, + * the argument is provided by the originator of the session request. */ - if (_managing_system) { - addr_t start = 0; - addr_t size = (sizeof(long) == 4) ? 0xc0000000UL : 0x100000000UL; + bool const direct_child = (session_label_from_args(args) == name()); - Arg_string::find_arg(args, "phys_start").ulong_value(start); - Arg_string::find_arg(args, "phys_size") .ulong_value(size); - - Arg_string::set_arg(args, args_len, "phys_start", String<32>(Hex(start)).string()); - Arg_string::set_arg(args, args_len, "phys_size", String<32>(Hex(size)) .string()); + if (direct_child && _managing_system) Arg_string::set_arg(args, args_len, "managing_system", "yes"); - } else { - Arg_string::remove_arg(args, "phys_start"); - Arg_string::remove_arg(args, "phys_size"); + + bool const client_arg = Arg_string::find_arg(args, "managing_system").bool_value(false); + + /* + * Preserve the client's wish for a 'managing_system' permission only + * if the node of the subsystem allows. + */ + bool const permitted = (_managing_system && client_arg); + + if (!permitted) Arg_string::remove_arg(args, "managing_system"); - } } }