Make label prefixing more strict

This patch unconditionally applies the labeling of sessions and thereby
removes the most common use case of 'Child_policy::filter_session_args'.
Furthermore, the patch removes an ambiguity of the session labels of
sessions created by the parent of behalf of its child, e.g., the PD
session created as part of 'Child' now has the label "<child-name>"
whereas an unlabeled PD-session request originating from the child
has the label "<child-name> -> ". This way, the routing-policy of
'Child_policy::resolve_session_request' can differentiate both cases.

As a consequence, the stricter labeling must now be considered wherever
a precise label was specified as a key for a session route or a server-
side policy selection. The simplest way to adapt those cases is to use a
'label_prefix' instead of the 'label' attribute. Alternatively, the
'label' attribute may used by appending " -> " (note the whitespace).

Fixes #2171
This commit is contained in:
Norman Feske 2016-11-24 15:28:32 +01:00 committed by Christian Helmuth
parent f184118930
commit 5a1cef6381
97 changed files with 254 additions and 375 deletions

View File

@ -35,7 +35,7 @@ install_config {
<start name="lx_fs">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config> <policy label="test-libc_vfs" root="/libc_vfs" writeable="yes" /> </config>
<config> <policy label_prefix="test-libc_vfs" root="/libc_vfs" writeable="yes" /> </config>
</start>
<start name="test-libc_vfs">
<resource name="RAM" quantum="2M"/>

View File

@ -297,16 +297,16 @@ class Genode::Child : protected Rpc_object<Parent>,
};
Env_connection<Ram_connection> _ram { _policy,
_id_space, Parent::Env::ram() };
_id_space, Parent::Env::ram(), _policy.name() };
Env_connection<Pd_connection> _pd { _policy,
_id_space, Parent::Env::pd() };
_id_space, Parent::Env::pd(), _policy.name() };
Env_connection<Cpu_connection> _cpu { _policy,
_id_space, Parent::Env::cpu() };
_id_space, Parent::Env::cpu(), _policy.name() };
Env_connection<Log_connection> _log { _policy,
_id_space, Parent::Env::log() };
_id_space, Parent::Env::log(), _policy.name() };
Env_connection<Rom_connection> _binary { _policy,
_id_space, Parent::Env::binary(), _policy.binary_name() };

View File

@ -42,9 +42,11 @@ struct Genode::Session_label : String<160>
if (full_len < _separator_len())
return full;
for (unsigned i = full_len - _separator_len(); i > 0; --i)
unsigned i = full_len - _separator_len();
do {
if (!strcmp(_separator(), full + i, _separator_len()))
return full + i + _separator_len();
} while (i-- > 0);
return Session_label(Cstring(full));
}
@ -91,16 +93,8 @@ namespace Genode {
inline Session_label prefixed_label(String<N1> const &prefix,
String<N2> const &label)
{
if (!prefix.valid() || prefix == "")
return Session_label(label.string());
if (!label.valid() || label == "")
return Session_label(prefix.string());
char buf[Session_label::capacity()];
snprintf(buf, sizeof(buf), "%s -> %s", prefix.string(), label.string());
return Session_label(Cstring(buf));
String<N1 + N2 + 4> const prefixed_label(prefix, " -> ", label);
return Session_label(prefixed_label);
}
}

View File

@ -33,14 +33,14 @@ proc platform_drv_policy {} {
if ([have_spec x86]) {
return {
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="nic_drv"> <pci class="ETHERNET"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="wifi_drv"> <pci class="WIFI"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="ahci_drv"> <pci class="AHCI"/> </policy>
<policy label="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
<policy label="intel_fb_drv" irq_mode="nomsi">
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
<policy label_prefix="nic_drv"> <pci class="ETHERNET"/> </policy>
<policy label_prefix="fb_drv"> <pci class="VGA"/> </policy>
<policy label_prefix="wifi_drv"> <pci class="WIFI"/> </policy>
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
<policy label_prefix="ahci_drv"> <pci class="AHCI"/> </policy>
<policy label_prefix="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
<policy label_prefix="intel_fb_drv" irq_mode="nomsi">
<pci class="VGA"/>
<pci bus="0" device="0" function="0"/>
<pci class="ISABRIDGE"/>

View File

@ -158,23 +158,6 @@ class Core_child : public Child_policy
** Child-policy interface **
****************************/
void filter_session_args(Service::Name const &, char *args, size_t args_len) override
{
using namespace Genode;
char label_buf[Parent::Session_args::MAX_SIZE];
Arg_string::find_arg(args, "label").string(label_buf, sizeof(label_buf), "");
char value_buf[Parent::Session_args::MAX_SIZE];
Genode::snprintf(value_buf, sizeof(value_buf),
"\"%s%s%s\"",
"init",
Genode::strcmp(label_buf, "") == 0 ? "" : " -> ",
label_buf);
Arg_string::set_arg(args, args_len, "label", value_buf);
}
Name name() const { return "init"; }
Service &resolve_session_request(Service::Name const &name,

View File

@ -188,8 +188,14 @@ Session_capability Child::session(Parent::Client::Id id,
char argbuf[Parent::Session_args::MAX_SIZE];
/* filter session arguments according to the child policy */
strncpy(argbuf, args.string(), sizeof(argbuf));
/* prefix session label */
Session_label const orig_label(label_from_args(argbuf));
Arg_string::set_arg_string(argbuf, sizeof(argbuf), "label",
prefixed_label(_policy.name(), orig_label).string());
/* filter session arguments according to the child policy */
_policy.filter_session_args(name.string(), argbuf, sizeof(argbuf));
/* filter session affinity */

View File

@ -128,15 +128,6 @@ class Test_child_policy : public Child_policy
return *service;
}
void filter_session_args(Service::Name const &,
char *args, size_t args_len)
{
/* prefix session label */
Session_label const orig(label_from_args(args));
Arg_string::set_arg_string(args, args_len, "label",
prefixed_label(name(), orig).string());
}
};

View File

@ -68,8 +68,8 @@ append config {
</config>
</inline>
</content>
<policy label="config_rom" root="/"/>
<policy label="intel_fb_controller" root="/" writeable="yes"/>
<policy label_prefix="config_rom" root="/"/>
<policy label_prefix="intel_fb_controller" root="/" writeable="yes"/>
</config>
</start>

View File

@ -70,9 +70,9 @@ set config {
<resource name="RAM" quantum="2M"/>
<provides><service name="Block"/></provides>
<config>
<policy label="vmlinux.1 -> sda" partition="1" />
<policy label="vmlinux.2 -> sda" partition="2" />
<policy label="test-libc_ffat" partition="3" />
<policy label="vmlinux.1 -> sda" partition="1" />
<policy label="vmlinux.2 -> sda" partition="2" />
<policy label_prefix="test-libc_ffat" partition="3" />
</config>
<route>
<service name="Block"> <child name="sd_card_drv"/> </service>

View File

@ -43,7 +43,7 @@ Here is an example snippet that configures the server:
!<start name="rump_fs">
! <resource name="RAM" quantum="8M" />
! <provides><service name="File_system"/></provides>
! <config fs="ext2fs"><policy label="" root="/" writeable="yes"/></config>
! <config fs="ext2fs"><default-policy root="/" writeable="yes"/></config>
!</start>
The server is looking for a service that provides a Genode block session. If

View File

@ -60,7 +60,7 @@ append config {
<start name="rump_fs">
<resource name="RAM" quantum="8M" />
<provides><service name="File_system"/></provides>
<config fs="ext2fs"><policy label="test-libc_vfs" root="/" writeable="yes"/></config>
<config fs="ext2fs"><policy label_prefix="test-libc_vfs" root="/" writeable="yes"/></config>
</start>
<start name="test-libc_vfs">
<resource name="RAM" quantum="4M"/>

View File

@ -54,7 +54,7 @@ append config {
<start name="rump_fs">
<resource name="RAM" quantum="8M" />
<provides><service name="File_system"/></provides>
<config fs="cd9660"><policy label="fs_rom" root="/" writeable="no"/></config>
<config fs="cd9660"><policy label_prefix="fs_rom" root="/" writeable="no"/></config>
</start>
<start name="fs_rom">
<resource name="RAM" quantum="2M"/>

View File

@ -62,7 +62,6 @@ class Launchpad_child : public Genode::Child_policy,
Genode::Session_requester _session_requester;
Init::Child_policy_enforce_labeling _labeling_policy { _name.string() };
Init::Child_policy_provide_rom_file _config_policy;
Genode::Child _child;
@ -182,12 +181,6 @@ class Launchpad_child : public Genode::Child_policy,
throw Genode::Parent::Service_denied();
}
void filter_session_args(Genode::Service::Name const &service,
char *args, Genode::size_t args_len) override
{
_labeling_policy.filter_session_args(service.string(), args, args_len);
}
void announce_service(Genode::Service::Name const &service_name) override
{
if (_find_service(_child_services, service_name)) {

View File

@ -108,7 +108,7 @@ append config {
<domain name="pointer" layer="1" label="no" content="client" origin="pointer" />
<domain name="default" layer="2" label="no" content="client" hover="always" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>

View File

@ -141,7 +141,7 @@ append config {
<dir name="tmp"/>
</content>
<!-- constrain sessions according to their labels -->
<policy label="fs_log" root="/samples" writeable="yes" />
<policy label_prefix="fs_log" root="/samples" writeable="yes" />
<policy label="noux -> home" root="/home" writeable="yes" />
<policy label="noux -> samples" root="/samples" />
<policy label="noux -> tmp" root="/tmp" writeable="yes" />

View File

@ -91,8 +91,8 @@ append config {
<resource name="RAM" quantum="4M"/>
<provides><service name="Nic"/></provides>
<config>
<policy label="lighttpd" ip_addr="10.0.1.1"/>
<policy label="http_blk" ip_addr="10.0.1.2"/>
<policy label_prefix="lighttpd" ip_addr="10.0.1.1"/>
<policy label_prefix="http_blk" ip_addr="10.0.1.2"/>
</config>
<route>
<service name="Nic">}

View File

@ -80,10 +80,10 @@ append config {
<domain name="default" layer="3" color="#ff0000" hover="always" focus="click" />
<domain name="decorator" layer="3" content="client" label="no" hover="always" focus="transient" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<policy label_prefix="wm -> launcher -> menu" domain="panel"/>
<policy label="wm -> decorator" domain="decorator"/>
<policy label="status_bar" domain="panel"/>
<policy label_prefix="wm -> decorator" domain="decorator"/>
<policy label_prefix="status_bar" domain="panel"/>
<default-policy domain="default"/>
<global-key name="KEY_SCROLLLOCK" label="xray_trigger" />
@ -157,8 +157,8 @@ append config {
<service name="Nitpicker"/>
</provides>
<config>
<policy label="decorator" role="decorator"/>
<policy label="layouter" role="layouter"/>
<policy label_prefix="decorator" role="decorator"/>
<policy label_prefix="layouter" role="layouter"/>
<policy label_prefix="launcher -> menu" role="direct"/>
<policy label_prefix="launcher -> testnit" role="direct"/>
</config>

View File

@ -53,7 +53,7 @@ append config {
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="3" content="client" label="no" hover="always" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>

View File

@ -94,8 +94,8 @@ append config {
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" label="no" hover="always" focus="click"/>
<policy label="pointer" domain="pointer"/>
<default-policy domain="default"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
<background color="#000000" />
</config>
@ -115,8 +115,8 @@ append config {
<resource name="RAM" quantum="16M"/>
<provides><service name="Nitpicker"/></provides>
<config>
<policy label="decorator" role="decorator"/>
<policy label="layouter" role="layouter"/>
<policy label_prefix="decorator" role="decorator"/>
<policy label_prefix="layouter" role="layouter"/>
</config>
<route>
<service name="Nitpicker"> <child name="nitpicker"/> </service>

View File

@ -61,7 +61,7 @@ append config {
<domain name="default" layer="2" content="client" label="no"/>
<domain name="nano3d" layer="1" content="client" label="no" origin="pointer"/>
<policy label="nano3d" domain="nano3d"/>
<policy label_prefix="nano3d" domain="nano3d"/>
<default-policy domain="default"/>
</config>
</start>

View File

@ -52,7 +52,7 @@ append config {
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="3" content="client" label="no" focus="click" hover="always" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>

View File

@ -61,7 +61,7 @@ set config {
<resource name="RAM" quantum="2560K"/>
<provides> <service name="Terminal"/> </provides>
<config>
<policy label="test-terminal_echo" port="8888"/>
<policy label_prefix="test-terminal_echo" port="8888"/>
<libc stdout="/dev/log">
<vfs> <dir name="dev"> <log/> </dir> </vfs>
</libc>

View File

@ -85,7 +85,7 @@ append config {
<config>
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" label="no" focus="click" hover="always" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
<route>

View File

@ -58,11 +58,11 @@ append config {
# on Fiasco.OC the kdb_uart_drv is always UART 0
append_if [have_spec foc] config {
<policy label="terminal_mux" uart="0" detect_size="yes"/> }
<policy label_prefix="terminal_mux" uart="0" detect_size="yes"/> }
# on all other kernels, direct terminal_mux to UART 1 (Qemu stdio, see below)
append_if [expr ![have_spec foc]] config {
<policy label="terminal_mux" uart="1" detect_size="yes"/> }
<policy label_prefix="terminal_mux" uart="1" detect_size="yes"/> }
append config {
</config>

View File

@ -104,7 +104,7 @@ append config {
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" label="no" hover="always" focus="click" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>
@ -138,8 +138,8 @@ append config {
<service name="Nitpicker"/>
</provides>
<config>
<policy label="decorator" role="decorator"/>
<policy label="layouter" role="layouter"/>
<policy label_prefix="decorator" role="decorator"/>
<policy label_prefix="layouter" role="layouter"/>
</config>
<route>
<any-service>

View File

@ -17,8 +17,8 @@ a given window label, the window's initial position and its maximized state
can be defined as follows:
! <config>
! <policy label="mupdf" maximized="yes"/>
! <policy label="nit_fb" xpos="50" ypos="50"/>
! <policy label_prefix="mupdf" maximized="yes"/>
! <policy label_prefix="nit_fb" xpos="50" ypos="50"/>
! </config>

View File

@ -2,8 +2,8 @@ File terminal is a service that provides a terminal-session interface and
redirects the terminal input and output to a file.
! <config>
! <policy label="client1" filename="test.txt" />
! <policy label="client2" filename="file.dat" io_buffer_size="4K"/>h
! <policy label_prefix="client1" filename="test.txt" />
! <policy label_prefix="client2" filename="file.dat" io_buffer_size="4K"/>h
! <libc stdout="/dev/log">
! <vfs>
! <dir name="dev"> <log/> </dir>

View File

@ -4,8 +4,8 @@ to be used for each client is defined in as session policy in the config node
of the TCP server:
! <config>
! <policy label="client" port="8181"/>
! <policy label="another_client" port="8282"/>
! <policy label_prefix="client" port="8181"/>
! <policy label_prefix="another_client" port="8282"/>
! </config>
For an example of how to use the TCP terminal, please refer to the run script

View File

@ -25,8 +25,8 @@ source ${genode_dir}/repos/base/run/platform_drv.inc
# override default platform driver policy
proc platform_drv_policy {} {
return {
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="acpica"> <pci class="ALL"/> </policy>}
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
<policy label_prefix="acpica"> <pci class="ALL"/> </policy>}
}
# add routing information to dynamically generate change of 'system' ROM

View File

@ -67,7 +67,7 @@ append config {
<config>
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" focus="click" hover="always" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
<route><any-service><parent/><any-child/></any-service></route>

View File

@ -75,7 +75,7 @@ append_if $use_ahci_drv config {
<resource name="RAM" quantum="10M"/>
<provides> <service name="Block"/> </provides>
<config ata="yes">
<policy label="test-libc_block" device="0"/>
<policy label_prefix="test-libc_block" device="0"/>
</config>
</start>
}

View File

@ -79,7 +79,7 @@ append_if $use_ahci_drv config {
<resource name="RAM" quantum="1M"/>
<provides> <service name="Block"/> </provides>
<config>
<policy label="ffat_fs" device="0" />
<policy label_prefix="ffat_fs" device="0" />
</config>
</start>
}

View File

@ -105,7 +105,7 @@ append_if $use_ahci config {
</route>
<config>}
append_if $use_ahci config "
<policy label=\"test-libc_$filesystem\" device=\"0\" />"
<policy label_prefix=\"test-libc_$filesystem\" device=\"0\" />"
append_if $use_ahci config {
</config>
</start>}

View File

@ -89,39 +89,39 @@ append config {
</ip>
</policy>
<policy label="http_srv_1" src="192.168.1.1" nat="yes" nat-tcp-ports="4">
<policy label_prefix="http_srv_1" src="192.168.1.1" nat="yes" nat-tcp-ports="4">
<ip dst="10.0.0.0/19" label="uplink" via="10.0.6.1" />
<ip dst="10.0.2.128/25" label="uplink" via="10.0.3.1" />
<ip dst="10.0.2.0/24" label="uplink" />
</policy>
<policy label="http_srv_2" src="192.168.1.1" nat="yes" nat-tcp-ports="2">
<policy label_prefix="http_srv_2" src="192.168.1.1" nat="yes" nat-tcp-ports="2">
<ip dst="10.0.2.0/24" label="uplink" />
</policy>
<policy label="http_clnt_3" src="100.200.0.1" nat="yes" nat-tcp-ports="4">
<policy label_prefix="http_clnt_3" src="100.200.0.1" nat="yes" nat-tcp-ports="4">
<ip dst="10.0.6.0/23" label="uplink" via="10.0.4.1" />
<ip dst="10.0.0.0/16" />
<ip dst="10.0.2.0/24" label="uplink" />
</policy>
<policy label="udp_srv_1" src="10.0.99.33" nat="yes" nat-udp-ports="1">
<policy label_prefix="udp_srv_1" src="10.0.99.33" nat="yes" nat-udp-ports="1">
<ip dst="10.0.2.0/24" label="uplink" />
<ip dst="10.0.98.0/24" label="udp_clnt_1" />
</policy>
<policy label="udp_srv_2" src="18.17.15.14">
<policy label_prefix="udp_srv_2" src="18.17.15.14">
<ip dst="10.0.2.0/24" label="uplink" />
</policy>
<policy label="udp_clnt_1" src="10.0.98.33">
<policy label_prefix="udp_clnt_1" src="10.0.98.33">
<ip dst="10.0.98.33/32">
<udp dst="1337" label="udp_srv_1" to="10.0.99.55"
via="10.0.99.55"/>
</ip>
</policy>
<policy label="udp_clnt_3" src="217.13.192.1" nat="yes" nat-udp-ports="2">
<policy label_prefix="udp_clnt_3" src="217.13.192.1" nat="yes" nat-udp-ports="2">
<ip dst="10.0.0.0/18" label="uplink" />
</policy>
@ -136,10 +136,10 @@ append config {
<resource name="RAM" quantum="10M"/>
<provides><service name="Nic"/></provides>
<config>
<policy label="nic_router" ip_addr="10.0.2.55"/>
<policy label="http_srv_3" ip_addr="10.0.2.11"/>
<policy label="udp_clnt_2" ip_addr="10.0.2.123"/>
<policy label="udp_srv_3" ip_addr="10.0.2.70"/>
<policy label_prefix="nic_router" ip_addr="10.0.2.55"/>
<policy label_prefix="http_srv_3" ip_addr="10.0.2.11"/>
<policy label_prefix="udp_clnt_2" ip_addr="10.0.2.123"/>
<policy label_prefix="udp_srv_3" ip_addr="10.0.2.70"/>
</config>
<route>
<service name="Nic"> <child name="nic_drv"/> </service>

View File

@ -73,7 +73,7 @@ proc qt5_start_nodes { feature_arg } {
<domain name="pointer" layer="1" label="no" content="client" origin="pointer" />
<domain name="default" layer="2" label="no" content="client" focus="click" hover="always" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>
@ -111,8 +111,8 @@ proc qt5_start_nodes { feature_arg } {
<service name="Nitpicker"/>
</provides>
<config>
<policy label="decorator" role="decorator"/>
<policy label="layouter" role="layouter"/>
<policy label_prefix="decorator" role="decorator"/>
<policy label_prefix="layouter" role="layouter"/>
</config>
<route>
<any-service>

View File

@ -54,7 +54,7 @@ append_if $use_ahci_driver config {
<resource name="RAM" quantum="5M"/>
<provides> <service name="Block"/> </provides>
<config>
<policy label="ffat_fs" device="0" />
<policy label_prefix="ffat_fs" device="0" />
</config>
</start>}
@ -70,8 +70,8 @@ append_if [have_spec linux] config {
<provides><service name="File_system"/></provides>
<config>
<!-- constrain sessions according to their labels -->
<policy label="textedit" root="/" writeable="yes" />
<policy label="textedit2" root="/" writeable="yes" />
<policy label_prefix="textedit" root="/" writeable="yes" />
<policy label_prefix="textedit2" root="/" writeable="yes" />
</config>
</start>}
@ -81,7 +81,7 @@ append_if [expr ![have_spec linux]] config {
<provides><service name="File_system"/></provides>
<config>
<!-- constrain sessions according to their labels -->
<policy label="textedit" root="/" writeable="yes" />
<policy label_prefix="textedit" root="/" writeable="yes" />
</config>
</start>}

View File

@ -54,7 +54,7 @@ append config {
<resource name="RAM" quantum="24M"/>
<provides><service name="Nic"/></provides>
<config>
<policy label="test-lwip_httpsrv_static" ip_addr="10.0.2.55"/>
<policy label_prefix="test-lwip_httpsrv_static" ip_addr="10.0.2.55"/>
</config>
<route>
<service name="Nic"> <child name="nic_drv"/> </service>

View File

@ -54,7 +54,7 @@ append config {
<resource name="RAM" quantum="24M"/>
<provides><service name="Nic"/></provides>
<config>
<policy label="lighttpd" ip_addr="10.0.2.55"/>
<policy label_prefix="lighttpd" ip_addr="10.0.2.55"/>
</config>
<route>
<service name="Nic"> <child name="nic_drv"/> </service>

View File

@ -71,7 +71,7 @@ Excerpt of important parts of the acpica configuration
!<start name="platform_drv" >
! ...
! <config acpi="yes" system="yes">
! <policy label="acpica"> <pci class="ALL"/> </policy>
! <policy label_prefix="acpica"> <pci class="ALL"/> </policy>
! ...
! </config>
!</start>

View File

@ -21,6 +21,6 @@ used:
! <resource name="RAM" quantum="8M"/>
! <provides> <service name="File_system"/> </provides>
! <config>
! <policy label="noux -> fuse" root="/" writeable="no" />
! <policy label_prefix="noux -> fuse" root="/" writeable="no" />
! </config>
! </start>

View File

@ -63,7 +63,6 @@ class Child_base : public Genode::Child_policy
enum { ENTRYPOINT_STACK_SIZE = 12*1024 };
Genode::Rpc_entrypoint _entrypoint;
Init::Child_policy_enforce_labeling _labeling_policy;
Genode::Child_policy_dynamic_rom_file _config_policy;
/**
@ -111,7 +110,6 @@ class Child_base : public Genode::Child_policy
_ref_ram_cap(ref_ram_cap), _ref_ram(ref_ram),
_ram_quota(ram_quota), _ram_limit(ram_limit),
_entrypoint(&pd_session, ENTRYPOINT_STACK_SIZE, _label.string(), false),
_labeling_policy(_label.string()),
_config_policy("config", _entrypoint, &ref_ram),
_yield_response_sigh_cap(yield_response_sig_cap),
_exit_sig_cap(exit_sig_cap),
@ -292,12 +290,6 @@ class Child_base : public Genode::Child_policy
return *new (Genode::env()->heap()) Parent_service(_parent_services, name);
}
void filter_session_args(Genode::Service::Name const &service,
char *args, Genode::size_t args_len) override
{
_labeling_policy.filter_session_args(service.string(), args, args_len);
}
void yield_response()
{
if (_withdraw_on_yield_response) {

View File

@ -493,7 +493,6 @@ class Init::Child : Genode::Child_policy,
/**
* Policy helpers
*/
Init::Child_policy_enforce_labeling _labeling_policy;
Init::Child_policy_handle_cpu_priorities _priority_policy;
Init::Child_policy_provide_rom_file _config_policy;
Init::Child_policy_redirect_rom_file _configfile_policy;
@ -542,7 +541,6 @@ class Init::Child : Genode::Child_policy,
_child_services(child_services),
_config(_env.ram(), _env.rm(), start_node),
_session_requester(_entrypoint, _env.ram(), _env.rm()),
_labeling_policy(_name.unique),
_priority_policy(_resources.prio_levels_log2, _resources.priority),
_config_policy("config", _config.dataspace(), &_entrypoint),
_configfile_policy("config", _config.filename()),
@ -758,7 +756,6 @@ class Init::Child : Genode::Child_policy,
void filter_session_args(Service::Name const &service,
char *args, Genode::size_t args_len) override
{
_labeling_policy. filter_session_args(service.string(), args, args_len);
_priority_policy. filter_session_args(service.string(), args, args_len);
_configfile_policy. filter_session_args(service.string(), args, args_len);
_ram_session_policy.filter_session_args(service.string(), args, args_len);

View File

@ -28,7 +28,6 @@
namespace Init {
class Child_policy_ram_phys;
class Child_policy_enforce_labeling;
class Child_policy_handle_cpu_priorities;
class Child_policy_provide_rom_file;
class Child_policy_provide_dynamic_rom;
@ -81,43 +80,6 @@ class Init::Child_policy_ram_phys
};
/**
* Policy for prepending the child name to the 'label' argument
*
* By applying this policy, the identity of the child becomes imprinted
* with each session request.
*/
class Init::Child_policy_enforce_labeling
{
const char *_name;
public:
Child_policy_enforce_labeling(const char *name) : _name(name) { }
/**
* Filter arguments of session request
*
* This method modifies the 'label' argument and leaves all other
* session arguments intact.
*/
void filter_session_args(const char *, char *args,
Genode::size_t args_len)
{
using namespace Genode;
Session_label const old_label = label_from_args(args);
if (old_label == "") {
Arg_string::set_arg_string(args, args_len, "label", _name);
} else {
Session_label const name(_name);
Session_label const new_label = prefixed_label(name, old_label);
Arg_string::set_arg_string(args, args_len, "label", new_label.string());
}
}
};
class Init::Child_policy_handle_cpu_priorities
{
/* priority parameters */

View File

@ -61,15 +61,14 @@ class Genode::Slave::Policy : public Child_policy
private:
Label const _label;
Binary_name const _binary_name;
Ram_session_client _ram;
Genode::Parent_service _binary_service;
size_t _ram_quota;
Parent_services _parent_services;
Rpc_entrypoint &_ep;
Init::Child_policy_enforce_labeling _labeling_policy;
Child_policy_dynamic_rom_file _config_policy;
Label const _label;
Binary_name const _binary_name;
Ram_session_client _ram;
Genode::Parent_service _binary_service;
size_t _ram_quota;
Parent_services _parent_services;
Rpc_entrypoint &_ep;
Child_policy_dynamic_rom_file _config_policy;
bool _service_permitted(Service::Name const &service_name) const
{
@ -106,7 +105,7 @@ class Genode::Slave::Policy : public Child_policy
:
_label(label), _binary_name(binary_name), _ram(ram_cap),
_binary_service(Rom_session::service_name()),
_ram_quota(ram_quota), _ep(ep), _labeling_policy(_label.string()),
_ram_quota(ram_quota), _ep(ep),
_config_policy("config", _ep, &_ram),
_session_requester(ep, _ram, rm)
{
@ -185,12 +184,6 @@ class Genode::Slave::Policy : public Child_policy
Id_space<Parent::Server> &server_id_space() override {
return _session_requester.id_space(); }
void filter_session_args(Service::Name const &service,
char *args, size_t args_len)
{
_labeling_policy.filter_session_args(service.string(), args, args_len);
}
};

View File

@ -57,7 +57,7 @@ append config {
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<config>
<policy label="test-ahci" device="0" />
<policy label_prefix="test-ahci" device="0" />
</config>
</start>

View File

@ -56,7 +56,7 @@ append config {
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<config>
<policy label="test-ahci" device="0" />
<policy label_prefix="test-ahci" device="0" />
</config>
</start>
<start name="test-ahci">

View File

@ -148,8 +148,8 @@ append config {
</else>
</if>
<inline>
<policy label="pointer" domain="pointer"/>
<policy label="status_bar" domain="panel"/>
<policy label_prefix="pointer" domain="pointer"/>
<policy label_prefix="status_bar" domain="panel"/>
<policy label_prefix="scout -> launchpad" domain="launchpad"/>
<default-policy domain=""/>

View File

@ -49,7 +49,7 @@ install_config {
<resource name="RAM" quantum="10M"/>
<provides> <service name="Loader"/> </provides>
<config>
<policy label="test-fault_detection">
<policy label_prefix="test-fault_detection">
<parent-rom name="test-segfault"/>
<parent-rom name="init"/>
</policy>

View File

@ -39,7 +39,7 @@ set config {
<log name="bomb-master.log"/>
<dir name="bomb-master"> <log name="bomb_g5.log"/> </dir>
</vfs>
<policy label="fs_log" writeable="yes"/>
<policy label_prefix="fs_log" writeable="yes"/>
</config>
</start>
<start name="fs_log">

View File

@ -51,7 +51,7 @@ set config {
<service name="Uart"/>
</provides>
<config>
<policy label="test-terminal_echo" uart="0" detect_size="yes"/>
<policy label_prefix="test-terminal_echo" uart="0" detect_size="yes"/>
</config>
</start>
<start name="test-terminal_echo">

View File

@ -77,7 +77,7 @@ append config {
<resource name="RAM" quantum="1M"/>
<provides><service name="Loader"/></provides>
<config>
<policy label="test-loader">
<policy label_prefix="test-loader">
<parent-rom name="testnit"/>
</policy>
</config>

View File

@ -63,7 +63,7 @@ append config {
<service name="Report"/>
</provides>
<config verbose="yes">
<policy label="to_whom_it_may_concern" report="mixer -> channel_list"/>
<policy label_prefix="to_whom_it_may_concern" report="mixer -> channel_list"/>
</config>
</start>

View File

@ -44,7 +44,7 @@ set config {
<resource name="RAM" quantum="1M"/>
<provides><service name="Terminal"/></provides>
<config>
<policy label="test-terminal_echo" uart="3"/>
<policy label_prefix="test-terminal_echo" uart="3"/>
</config>
</start>
<start name="test-terminal_echo">

View File

@ -68,8 +68,8 @@ install_config {
<any-service><child name="rom_blk"/> <parent/><any-child/></any-service>
</route>
<config>
<policy label="test-part1" partition="6"/>
<policy label="test-part2" partition="1"/>
<policy label_prefix="test-part1" partition="6"/>
<policy label_prefix="test-part2" partition="1"/>
</config>
</start>
<start name="test-part1">

View File

@ -49,7 +49,7 @@ install_config {
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system" /> </provides>
<config>
<policy label="rom_to_file" root="/fs_test" writeable="yes" />
<policy label_prefix="rom_to_file" root="/fs_test" writeable="yes" />
</config>
</start>
<start name="rom_to_file">

View File

@ -41,7 +41,7 @@ append config {
<start name="test-trace">
<resource name="RAM" quantum="10M"/>
<config>
<trace_policy label="init -> test-trace" module="rpc_name" />
<trace_policy label_prefix="init -> test-trace" module="rpc_name" />
</config>
</start>
</config>}

View File

@ -45,8 +45,8 @@ set config {
<service name="Terminal"/>
</provides>
<config>
<policy label="test-uart1" uart="1"/>
<policy label="test-uart2" uart="1"/>
<policy label_prefix="test-uart1" uart="1"/>
<policy label_prefix="test-uart2" uart="1"/>
</config>
</start>
<start name="test-uart1">

View File

@ -48,7 +48,7 @@ install_config {
<service name="Uart"/>
</provides>
<config>
<policy label="vmm" uart="1"/>
<policy label_prefix="vmm" uart="1"/>
</config>
</start>
<start name="vmm">

View File

@ -19,9 +19,9 @@ which client can access a certain device:
! </route>
! <config atapi="no">
! <!-- use model and serial number -->
! <policy label="test-ahci" model="QEMU HARDDISK" serial="QM00005" />
! <policy label_prefix="test-ahci" model="QEMU HARDDISK" serial="QM00005" />
! <!-- use controller port number -->
! <policy label="bench" device="1" />
! <policy label_prefix="bench" device="1" />
! </config>
!</start>

View File

@ -26,7 +26,7 @@ explicitly configured by the triple 'bus', 'device', 'function':
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! ...
! <config>
! <policy label="usb_drv">
! <policy label_prefix="usb_drv">
! <pci bus="0" device="19" function="0"/>
! <pci bus="0" device="18" function="3"/>
! </policy>
@ -39,7 +39,7 @@ or more fuzzy by a device class alias:
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! ...
! <config>
! <policy label="usb_drv">
! <policy label_prefix="usb_drv">
! <pci class="USB"/>
! </policy>
! </config>
@ -51,7 +51,7 @@ Non PCI devices, as the PS2 controller are named by a "device" node in the polic
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! <config>
! <policy label="ps_drv">
! <policy label_prefix="ps_drv">
! <device name="PS2/>
! </policy>
! </config>
@ -72,7 +72,7 @@ supports it. This behaviour can be overwritten:
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! <config>
! <policy label="nic_drv" irq_mode="nomsi">
! <policy label_prefix="nic_drv" irq_mode="nomsi">
! ...
! </policy>
! </config>
@ -171,7 +171,7 @@ The driver provides for the PS2 controller the IO_PORT and IRQ resources.
!<start name="platform_drv">
! <resource name="RAM" quantum="8M" constrain_phys="yes"/>
! <config>
! <policy label="ps_drv">
! <policy label_prefix="ps_drv">
! <dev name="PS2/>
! </policy>
! </config>

View File

@ -15,9 +15,9 @@ via Genode's config mechanism.
assumed to be used by the kernel and, therefore, left untouched.
! <config>
! <policy label="test-uart1" uart="1" detect_size="yes" />
! <policy label="test-uart2" uart="2" />
! <policy label="test-uartx" uart="1" />
! <policy label_prefix="test-uart1" uart="1" detect_size="yes" />
! <policy label_prefix="test-uart2" uart="2" />
! <policy label_prefix="test-uartx" uart="1" />
! </config>
If the 'detect_size' attribute is set to "yes", the UART driver will

View File

@ -17,7 +17,7 @@ the file "/log".
! <resource name="RAM" quantum="1M"/>
! <provides><service name="LOG"/></provides>
! <config>
! <policy label="nic_drv" truncate="no"/>
! <policy label_prefix="nic_drv" truncate="no"/>
! <policy label_prefix="cli_monitor -> " merge="yes"/>
! <default-policy truncate="yes"/>
! </config>

View File

@ -50,8 +50,6 @@ namespace Loader {
Service &_local_cpu_service;
Service &_local_pd_service;
Init::Child_policy_enforce_labeling _labeling_policy;
Genode::Child _child;
public:
@ -76,7 +74,6 @@ namespace Loader {
_local_rom_service(local_rom_service),
_local_cpu_service(local_cpu_service),
_local_pd_service(local_pd_service),
_labeling_policy(_label.string()),
_child(_env.rm(), _env.ep().rpc_ep(), *this)
{ }
@ -100,11 +97,6 @@ namespace Loader {
ref_ram().transfer_quota(ram_cap, _ram_quota);
}
void filter_session_args(Service::Name const &service, char *args, size_t args_len) override
{
_labeling_policy.filter_session_args(service.string(), args, args_len);
}
Service &resolve_session_request(Service::Name const &name,
Session_state::Args const &args) override
{

View File

@ -26,7 +26,7 @@ address to a client with the session label "lighttpd".
!<start name="nic_bridge">
! ...
! <config>
! <policy label="lighttpd" ip_addr="10.0.2.55"/>
! <policy label_prefix="lighttpd" ip_addr="10.0.2.55"/>
! </config>
!</start>

View File

@ -19,9 +19,9 @@ expressed via '<policy>' nodes as illustrated by the following example:
! <config>
! ...
! <policy label="pointer" domain="pointer"/>
! <policy label="status_bar" domain="panel"/>
! <policy label="" domain=""/>
! <policy label_prefix="pointer" domain="pointer"/>
! <policy label_prefix="status_bar" domain="panel"/>
! <default-policy domain=""/>
! ...
! </config>

View File

@ -46,8 +46,8 @@ Configuration snippet with two clients and an (hypothetical) IDE driver:
! <!-- allow program 'test-part1' to access logical partition '6', while program
! 'test-part2' receives access to primary partition 1 -->
! <config>
! <policy label="test-part1" partition="6"/>
! <policy label="test-part2" partition="1"/>
! <policy label_prefix="test-part1" partition="6"/>
! <policy label_prefix="test-part2" partition="1"/>
! </config>
!</start>
!

View File

@ -37,7 +37,7 @@ To use the trace_fs, a configuration similar to the following may be used:
! <resource name="RAM" quantum="128M"/>
! <provides><service name="File_system"/></provides>
! <config>
! <policy label="noux -> trace"
! <policy label_prefix="noux -> trace"
! interval="1000"
! subject_limit="512"
! trace_quota="64M" />

View File

@ -44,8 +44,7 @@ class Bomb_child : public Child_policy
Registry<Registered<Parent_service> > &_parent_services;
Init::Child_policy_enforce_labeling _labeling_policy { _label.string() };
Child_policy_dynamic_rom_file _config_policy { "config", _ep, &_env.ram() };
Child_policy_dynamic_rom_file _config_policy { "config", _ep, &_env.ram() };
Child _child { _env.rm(), _ep, *this };
@ -87,12 +86,6 @@ class Bomb_child : public Child_policy
Ram_session &ref_ram() override { return _env.ram(); }
Ram_session_capability ref_ram_cap() const override { return _env.ram_session_cap(); }
void filter_session_args(Service::Name const &,
char *args, size_t args_len) override
{
_labeling_policy.filter_session_args(nullptr, args, args_len);
}
Service &resolve_session_request(Service::Name const &service_name,
Session_state::Args const &args) override
{

View File

@ -134,15 +134,6 @@ class Test_child : public Genode::Child_policy
throw Parent::Service_denied();
}
void filter_session_args(Service::Name const &,
char *args, size_t args_len) override
{
/* prefix session label */
Session_label const orig(label_from_args(args));
Arg_string::set_arg_string(args, args_len, "label",
prefixed_label(name(), orig).string());
}
};

View File

@ -182,7 +182,7 @@ Child::Child(Genode::Env &env, Genode::Xml_node config)
* The parent grants resource requests as long as it has free resources.
* Once in a while, it politely requests the child to yield resources.
*/
class Parent : Genode::Slave::Policy
class Parent
{
private:
@ -190,10 +190,6 @@ class Parent : Genode::Slave::Policy
typedef Genode::size_t size_t;
enum { SLAVE_QUOTA = 10*1024*1024 };
Genode::Child _child = { _env.rm(), _env.ep().rpc_ep(), *this };
Timer::Connection _timer { _env };
Genode::Lock _yield_blockade;
@ -254,40 +250,7 @@ class Parent : Genode::Slave::Policy
}
}
Genode::Signal_handler<Parent> _timeout_handler {
_env.ep(), *this, &Parent::_handle_timeout };
public:
class Insufficient_yield { };
/**
* Constructor
*/
Parent(Genode::Env &env)
:
Genode::Slave::Policy(Label(), "test-resource_yield", env.ep().rpc_ep(),
env.rm(), env.ram_session_cap(), SLAVE_QUOTA),
_env(env)
{
configure("<config child=\"yes\" />");
_timer.sigh(_timeout_handler);
_init();
}
/****************************
** Slave_policy interface **
****************************/
char const **_permitted_services() const
{
static char const *services[] = { "RAM", "PD", "CPU", "ROM", "LOG", "Timer" };
return services;
}
void yield_response()
void _yield_response()
{
Genode::log("got yield response");
_state = YIELD_GOT_RESPONSE;
@ -308,6 +271,54 @@ class Parent : Genode::Slave::Policy
_env.parent().exit(0);
}
}
Genode::Signal_handler<Parent> _timeout_handler {
_env.ep(), *this, &Parent::_handle_timeout };
struct Policy : Genode::Slave::Policy
{
Parent &_parent;
enum { SLAVE_QUOTA = 10*1024*1024 };
char const **_permitted_services() const override
{
static char const *services[] = { "RAM", "PD", "CPU", "ROM", "LOG", "Timer" };
return services;
}
void yield_response() override
{
_parent._yield_response();
}
Policy(Parent &parent, Genode::Env &env)
:
Genode::Slave::Policy(Label("child"), "test-resource_yield",
env.ep().rpc_ep(), env.rm(),
env.ram_session_cap(), SLAVE_QUOTA),
_parent(parent)
{
configure("<config child=\"yes\" />");
}
};
Policy _policy { *this, _env };
Genode::Child _child { _env.rm(), _env.ep().rpc_ep(), _policy };
public:
class Insufficient_yield { };
/**
* Constructor
*/
Parent(Genode::Env &env) : _env(env)
{
_timer.sigh(_timeout_handler);
_init();
}
};

View File

@ -59,7 +59,7 @@ set config {
<service name="Terminal"/>
<service name="Uart"/>
</provides>
<config><policy label="l4linux" uart="0"/></config>
<config><policy label_prefix="l4linux" uart="0"/></config>
</start> }
append_platform_drv_config

View File

@ -54,7 +54,7 @@ set config {
<service name="Terminal"/>
<service name="Uart"/>
</provides>
<config><policy label="l4linux" uart="0" detect_size="yes"/></config>
<config><policy label_prefix="l4linux" uart="0" detect_size="yes"/></config>
</start>
<start name="ahci_drv">
<resource name="RAM" quantum="1M"/>

View File

@ -101,7 +101,7 @@ append config {
<service name="Terminal"/>
<service name="Uart"/>
</provides>
<config><policy label="l4linux" uart="0"/></config>
<config><policy label_prefix="l4linux" uart="0"/></config>
</start>
<start name="usb_drv">
<binary name="usb_drv"/>

View File

@ -70,9 +70,9 @@ set config {
<resource name="RAM" quantum="2M"/>
<provides><service name="Block"/></provides>
<config>
<policy label="vmlinux.1 -> sda" partition="1" />
<policy label="vmlinux.2 -> sda" partition="2" />
<policy label="test-libc_ffat" partition="3" />
<policy label="vmlinux.1 -> sda" partition="1" />
<policy label="vmlinux.2 -> sda" partition="2" />
<policy label_prefix="test-libc_ffat" partition="3" />
</config>
<route>
<service name="Block"> <child name="sd_card_drv"/> </service>

View File

@ -210,7 +210,7 @@ For using an UART, add the following start entry to the scenario:
! <resource name="RAM" quantum="1M"/>
! <provides> <service name="Terminal"/> </provides>
! <config>
! <policy label="gdb_monitor" uart="1"/>
! <policy label_prefix="gdb_monitor" uart="1"/>
! </config>
! </start>
This entry will start the UART driver and defines the policy of which UART to

View File

@ -65,7 +65,7 @@ append config {
<resource name="RAM" quantum="2M"/>
<provides><service name="Loader"/></provides>
<config>
<policy label="arora">
<policy label_prefix="arora">
<parent-rom name="ld.lib.so"/>
<parent-rom name="init"/>
<parent-rom name="tar_rom"/>

View File

@ -60,7 +60,7 @@ set config {
<resource name="RAM" quantum="1M"/>
<provides> <service name="Terminal"/> </provides>
<config>
<policy label="gdb_monitor" uart="1"/>
<policy label_prefix="gdb_monitor" uart="1"/>
</config>
</start>
<start name="gdb_monitor">
@ -71,7 +71,7 @@ set config {
<config>
<domain name="pointer" layer="1" xray="no" origin="pointer" />
<domain name="default" layer="3" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</target>

View File

@ -14,10 +14,10 @@ source ${genode_dir}/repos/base/run/platform_drv.inc
# override default platform driver policy
proc platform_drv_policy {} {
return {
<policy label="ps2_drv"> <device name="PS2"/> </policy>
<policy label="usb_drv"> <pci class="USB"/> </policy>
<policy label="fb_drv"> <pci class="VGA"/> </policy>
<policy label="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>}
<policy label_prefix="ps2_drv"> <device name="PS2"/> </policy>
<policy label_prefix="usb_drv"> <pci class="USB"/> </policy>
<policy label_prefix="fb_drv"> <pci class="VGA"/> </policy>
<policy label_prefix="audio_drv"> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>}
}
append_platform_drv_build_components

View File

@ -59,7 +59,7 @@ set config {
<service name="Uart"/>
</provides>
<config>
<policy label="gdb_monitor" uart="1"/>
<policy label_prefix="gdb_monitor" uart="1"/>
</config>
</start>
<start name="gdb_monitor">

View File

@ -46,7 +46,7 @@ set config {
<resource name="RAM" quantum="2M"/>
<provides> <service name="Terminal"/> </provides>
<config>
<policy label="gdb_monitor" uart="1"/>
<policy label_prefix="gdb_monitor" uart="1"/>
</config>
</start>
<start name="gdb_monitor">

View File

@ -45,7 +45,7 @@ set config {
<resource name="RAM" quantum="1M"/>
<provides> <service name="Terminal"/> </provides>
<config>
<policy label="gdb_monitor" uart="1"/>
<policy label_prefix="gdb_monitor" uart="1"/>
</config>
</start>
<start name="gdb_monitor">

View File

@ -40,7 +40,7 @@ append config {
<resource name="RAM" quantum="1M"/>
<provides><service name="Terminal"/></provides>
<config>
<policy label="noux" uart="1"/>
<policy label_prefix="noux" uart="1"/>
</config>
</start>
<start name="ram_fs">

View File

@ -131,7 +131,7 @@ append_if $use_nic_bridge config {
<provides><service name="Nic"/></provides>
<config>}
append_if [expr $use_nic_bridge && [have_spec linux]] config "
<policy label=\"netserver_genode\" ip_addr=\"$lx_ip_addr\"/>"
<policy label_prefix=\"netserver_genode\" ip_addr=\"$lx_ip_addr\"/>"
append_if $use_nic_bridge config {
</config>
<route>
@ -174,7 +174,7 @@ append_if $use_wifi_driver config {
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<policy label="config_rom" root="/"/>
<policy label_prefix="config_rom" root="/"/>
<policy label="wifi_drv -> config" root="/" writeable="yes"/>
<content>
<inline name="wlan_configuration">}

View File

@ -77,11 +77,11 @@ append config {
# on Fiasco.OC the kdb_uart_drv is always UART 0
append_if [have_spec foc] config {
<policy label="terminal_mux" uart="0" detect_size="yes"/> }
<policy label_prefix="terminal_mux" uart="0" detect_size="yes"/> }
# on all other kernels, direct terminal_mux to UART 1 (Qemu stdio, see below)
append_if [expr ![have_spec foc]] config {
<policy label="terminal_mux" uart="1" detect_size="yes"/> }
<policy label_prefix="terminal_mux" uart="1" detect_size="yes"/> }
append config {
</config>

View File

@ -70,7 +70,7 @@ append_if [have_include "power_on/qemu"] config {
<service name="Uart"/>
</provides>
<config>
<policy label="noux_net" uart="1"/>
<policy label_prefix="noux_net" uart="1"/>
</config>
</start>}
@ -84,7 +84,7 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</route>
<config>
<policy label="noux_net" port="8888"/>
<policy label_prefix="noux_net" port="8888"/>
</config>
</start>
<start name="nic_bridge">

View File

@ -35,7 +35,7 @@ append config {
<resource name="RAM" quantum="2M"/>
<provides><service name="Terminal"/></provides>
<config>
<policy label="noux" uart="1"/>
<policy label_prefix="noux" uart="1"/>
</config>
</start>
<start name="noux">

View File

@ -90,7 +90,7 @@ append config {
<config>
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" focus="click" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
<route> }

View File

@ -90,7 +90,7 @@ append config {
<config>
<domain name="pointer" layer="1" content="client" label="no" origin="pointer" />
<domain name="default" layer="2" content="client" focus="click" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
<route> }

View File

@ -289,8 +289,8 @@ append_if $use_fancy_stuff config {
<domain name="panel" layer="2" content="client" label="no" focus="none" />
<domain name="" layer="3" content="client" focus="click"
hover="always" ypos="18" height="-18" />
<policy label="pointer" domain="pointer"/>
<policy label="status_bar" domain="panel"/>
<policy label_prefix="pointer" domain="pointer"/>
<policy label_prefix="status_bar" domain="panel"/>
<default-policy domain=""/>
</config>
<route>

View File

@ -148,7 +148,7 @@ set config_of_app {
<resource name="RAM" quantum="5M"/>
<provides> <service name="Terminal"/> </provides>
<config>
<policy label="noux" port="8888"/>
<policy label_prefix="noux" port="8888"/>
</config>
</start>

View File

@ -89,9 +89,9 @@ set config {
<domain name="smiley" layer="3" content="client" label="no"/>
<domain name="default" layer="3" content="client" label="no"/>
<policy label="pointer" domain="pointer"/>
<policy label="test-domain-smiley" domain="smiley"/>
<default-policy domain="default"/>
<policy label_prefix="pointer" domain="pointer"/>
<policy label_prefix="test-domain-smiley" domain="smiley"/>
<default-policy domain="default"/>
<background color="#00426f"/> <!-- indigo -->
</config>
@ -186,9 +186,9 @@ set config {
<resource name="RAM" quantum="1M"/>
<config>
<default-policy domain="smiley" rom="smiley"/>
<policy label="test-label-arrow" rom="arrow"/>
<policy label="test-label-blade" rom="blade"/>
<policy label="test-label-bladex" rom="bladex"/>
<policy label_prefix="test-label-arrow" rom="arrow"/>
<policy label_prefix="test-label-blade" rom="blade"/>
<policy label_prefix="test-label-bladex" rom="bladex"/>
</config>
<route>
<service name="RM"> <parent/> </service>

View File

@ -137,8 +137,8 @@ append config_of_app {
<domain name="cpu_load" layer="2" content="client" label="no" />
<domain name="" layer="3" content="client" focus="click" hover="always" />
<policy label="vbox_pointer" domain="pointer"/>
<policy label="cpu_load_display" domain="cpu_load"/>
<policy label_prefix="vbox_pointer" domain="pointer"/>
<policy label_prefix="cpu_load_display" domain="cpu_load"/>
<default-policy domain=""/>
</config>
</start>
@ -149,7 +149,7 @@ append config_of_app {
for { set i 1} { $i <= $use_vms } { incr i} {
append config_of_app "
<policy label=\"nit_fb$i\" rom=\"shape$i\"/>"
<policy label_prefix=\"nit_fb$i\" rom=\"shape$i\"/>"
}
append config_of_app {

View File

@ -77,7 +77,7 @@ append config {
<resource name="RAM" quantum="10M"/>
<provides><service name="Block"/></provides>
<config>
<policy label="part_blk" device="0"/>
<policy label_prefix="part_blk" device="0"/>
</config>
</start>
<start name="part_blk" priority="-1">
@ -88,9 +88,9 @@ append config {
</route>
<config>}
append_if [expr $use_rumpfs] config {
<policy label="rump_fs" partition="4"/>}
<policy label_prefix="rump_fs" partition="4"/>}
append_if [expr !$use_rumpfs] config {
<policy label="vbox1 -> raw" partition="3"/>}
<policy label_prefix="vbox1 -> raw" partition="3"/>}
append config {
</config>
</start>}
@ -102,7 +102,7 @@ append_if [expr $use_rumpfs] config {
<config ld_verbose="yes" fs="ext2fs">}
append_if [expr $use_rumpfs && $use_ram_fs && $use_overlay_from_disk] config {
<policy label="overlay_from_disk" root="/ram" writeable="yes"/>}
<policy label_prefix="overlay_from_disk" root="/ram" writeable="yes"/>}
append_if [expr $use_rumpfs] config {
<default-policy root="/" writeable="yes"/>
</config>
@ -130,7 +130,7 @@ append_if [expr $use_ram_fs] config {
<!-- constrain sessions according to their labels -->}
for { set i 1} { $i <= ${use_vms} } { incr i} {
append_if [expr $use_ram_fs] config "
<policy label=\"vbox${i} -> from_ram_fs\" root=\"/ram${i}\" writeable=\"yes\"/>"
<policy label_prefix=\"vbox${i} -> from_ram_fs\" root=\"/ram${i}\" writeable=\"yes\"/>"
}
append_if [expr $use_ram_fs] config {
</config>

View File

@ -26,7 +26,7 @@
<config>
<domain name="pointer" layer="1" label="no" content="client" xray="no" origin="pointer" />
<domain name="default" layer="2" label="no" content="client" hover="always" focus="click" />
<policy label="pointer" domain="pointer"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</start>

View File

@ -44,8 +44,6 @@ class Gdb_monitor::App_child : public Child_policy
enum { STACK_SIZE = 4*1024*sizeof(long) };
Init::Child_policy_enforce_labeling _labeling_policy;
Genode::Env &_env;
Genode::Ram_session_capability _ref_ram_cap { _env.ram_session_cap() };
@ -245,32 +243,28 @@ class Gdb_monitor::App_child : public Child_policy
/**
* Constructor
*
* \param root_ep entrypoint serving the root interfaces of the
* services provided by the child and announced
* towards the parent of GDB monitor
*/
App_child(Genode::Env &env,
const char *unique_name,
Genode::Pd_session &pd,
Genode::Region_map &rm,
Genode::size_t ram_quota,
Signal_receiver *signal_receiver,
Xml_node target_node)
: _labeling_policy(unique_name),
_env(env),
_unique_name(unique_name),
_rm(rm),
_ram_quota(ram_quota),
_entrypoint(&pd, STACK_SIZE, "GDB monitor entrypoint"),
_child_config(env.ram(), rm, target_node),
_config_policy("config", _child_config.dataspace(), &_entrypoint),
_unresolved_page_fault_dispatcher(*signal_receiver,
*this,
&App_child::_dispatch_unresolved_page_fault),
_cpu_factory(_env, _entrypoint, Genode::env()->heap(), _pd.core_pd_cap(),
signal_receiver, &_genode_child_resources),
_rom_factory(env, _entrypoint)
App_child(Genode::Env &env,
const char *unique_name,
Genode::Pd_session &pd,
Genode::Region_map &rm,
Genode::size_t ram_quota,
Signal_receiver *signal_receiver,
Xml_node target_node)
:
_env(env),
_unique_name(unique_name),
_rm(rm),
_ram_quota(ram_quota),
_entrypoint(&pd, STACK_SIZE, "GDB monitor entrypoint"),
_child_config(env.ram(), rm, target_node),
_config_policy("config", _child_config.dataspace(), &_entrypoint),
_unresolved_page_fault_dispatcher(*signal_receiver,
*this,
&App_child::_dispatch_unresolved_page_fault),
_cpu_factory(_env, _entrypoint, Genode::env()->heap(), _pd.core_pd_cap(),
signal_receiver, &_genode_child_resources),
_rom_factory(env, _entrypoint)
{
_genode_child_resources.region_map_component(&_pd.region_map());
_pd.region_map().fault_handler(_unresolved_page_fault_dispatcher);
@ -308,11 +302,6 @@ class Gdb_monitor::App_child : public Child_policy
_ref_ram.transfer_quota(cap, _ram_quota);
}
void filter_session_args(Service::Name const&, char *args, Genode::size_t args_len) override
{
_labeling_policy.filter_session_args(0, args, args_len);
}
Service &resolve_session_request(Genode::Service::Name const &service_name,
Genode::Session_state::Args const &args) override
{

View File

@ -9,9 +9,9 @@ defined for labels or domains of the sessions.
! <start name="vbox_pointer">
! <resource name="RAM" quantum="1M"/>
! <config>
! <policy domain="smiley" rom="smiley"/>
! <policy label="test-label-arrow" rom="arrow"/>
! <policy label="test-label-blade" rom="blade"/>
! <default-policy domain="smiley" rom="smiley"/>
! <policy label_prefix="test-label-arrow" rom="arrow"/>
! <policy label_prefix="test-label-blade" rom="blade"/>
! </config>
! </start>

View File

@ -39,7 +39,6 @@ namespace Noux {
Name const _name;
Binary_name const _binary_name;
Init::Child_policy_enforce_labeling _labeling_policy;
Init::Child_policy_provide_rom_file _args_policy;
Init::Child_policy_provide_rom_file _env_policy;
Init::Child_policy_provide_rom_file _config_policy;
@ -93,7 +92,6 @@ namespace Noux {
:
_name(name),
_binary_name(binary_name),
_labeling_policy(_name.string()),
_args_policy( "args", args_ds, &entrypoint),
_env_policy( "env", env_ds, &entrypoint),
_config_policy("config", config_ds, &entrypoint),
@ -160,12 +158,6 @@ namespace Noux {
throw Parent::Service_denied();
}
void filter_session_args(Genode::Service::Name const &service,
char *args, Genode::size_t args_len) override
{
_labeling_policy.filter_session_args(service.string(), args, args_len);
}
void exit(int exit_value) override
{
_exit_value = exit_value;