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

David Werner wernerd at ...389...
Mon Mar 6 14:29:27 CET 2017


Hi Norman,

thank you for you answer!

The RO attach sounds indeed like a mechanism that would fit our scenario.

May i ask you some more questions on this idea?

> RO attach
>
> In addition to the read/write permission as stored in the dataspace, we
> may add the same property to 'Region' objects, which are created
> whenever a dataspace is attached via 'Region_map::attach'.
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?

>   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?


Kind Regards,
David




More information about the users mailing list