Make RAM dataspaces read-only (sth similar to mprotect in Linux)

Norman Feske norman.feske at ...1...
Mon Mar 6 16:13:14 CET 2017

Hi David,

> Does the '_write' flag in  'Rm_region' already specify whether the 
> 'Region' is writable or not?
> May i use it to determine if the corresponding Mapping should be 
> writable or do i need to implement another flag?

indeed, the flag is unused right now but it was apparently designated
for this purpose. Please go ahead with using it.

>>   By specifying
>> that a dataspace should be attached read-only, the resulting mapping
>> will always be read-only regardless of whether the underlying dataspace
>> is writable. As far as I see, the implementation wouldn't be too hard.
>> When resolving page faults, the pager would logically-AND the r/w
>> conditions of the traversed region maps (they may be nested so the
>> downgrade from RW to RO could happen at any level) with the property of
>> the dataspace.
> As far as i can follow your description i would have to do the following 
> two things:
> 1. Provide an alternative implementation for 
> 'Region_map_component::attach' which allows to create
>   a read-only 'Region' (corresponding flag set)
> 2. Modify the method 'Rm_client::pager' in order to take the flag of the 
> region into account when creating mappings.
>   (At the moment only the property of the dataspace is considered)
> Is that everything or did i miss something?

As far as I can see, that's all. Good luck!


Dr.-Ing. Norman Feske
Genode Labs ·

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth

More information about the users mailing list