Policy Representation Overview
Here is an overview of the new policy representation [1]. It includes much of the initial design as we understand it, plus a few modifications. The significant differences are:
1. A single symbol table at the root node of the abstract syntax tree, rather than a symbol table per block.
2. The distinction between types and attributes. The two implement the 'Typeset Object' interface, but are not subclasses to each other.
3. The distinction of 'policy statements'. Examples are 'typeattribute' and 'typealias'.
Here are the reasons for these three changes:
1. A single symbol table allows for easier name symbol resolution. Consider if one optional block defines a symbol that another optional block uses. With a single symbol table, the latter optional only need to search the top-most, authoritative symbol table for the symbol's existence. Otherwise it would need to recurse into every single block to find the symbol as that the top-most did not define it.
2. Although types and attributes may be used interchangably within AV rules, they are not valid tokens in many other parts of a policy. For example, the default of a 'type_transition' must be a type, not an attribute. Likewise, the one cannot assign an attribute to a type within 'typeattribute'; the operation is really adding the type to an attribute's type list.
3. The inclusion of the statements simplify the process of linking in modules. Because modules can have typeattribute statements, it is necessary to append a type to an attribute's type list. It is possible that either the type or attribute is defined in the module; thus it is necessary to defer resolving the 'typeattribute' until after symbols have been linked.
[1] http://oss.tresys.com/projects/setools/chrome/site/policy-rep/overview.pdf
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 7 lines · Christopher J. PeBenito
Here is an overview of the new policy representation [1]. It includes much of the initial design as we understand it, plus a few modifications. The significant differences are:
1. A single symbol table at the root node of the abstract syntax tree, rather than a symbol table per block.
Not certain what this means - there is no symbol table at all. If you mean the object pool the intention was that would always been in the root of the tree.
Quoted 6 lines
2. The distinction between types and attributes. The two implement the 'Typeset Object' interface, but are not subclasses to each other.
3. The distinction of 'policy statements'. Examples are 'typeattribute' and 'typealias'.
Quoted 9 lines
Here are the reasons for these three changes:
1. A single symbol table allows for easier name symbol resolution. Consider if one optional block defines a symbol that another optional block uses. With a single symbol table, the latter optional only need to search the top-most, authoritative symbol table for the symbol's existence. Otherwise it would need to recurse into every single block to find the symbol as that the top-most did not define it.
Again - still not certain what you are getting at. If you look at the policy check patch that I sent the first thing that it does is build indexes of symbols (name->object). That solves this problem without the overhead of keeping these indexes updated when the tree is being manipulated.
In fact, one of the explicit goals of this design is to store information once and only once in the tree. The indexing and top-level symbol tables in the current design have been nothing but a bother.
Quoted 7 lines
2. Although types and attributes may be used interchangably within AV rules, they are not valid tokens in many other parts of a policy. For example, the default of a '
type_transition' must be a type, not an attribute. Likewise, the one cannot assign an attribute to a type within 'typeattribute'; the operation is really adding the type to an attribute's type list.
Sure, but type and attributes are already separate objects.
Quoted 7 lines
3. The inclusion of the statements simplify the process of linking in modules. Because modules can have typeattribute statements, it is necessary to append a type to an attribute's type list. It is possible that either the type or attribute is defined in the module; thus it is necessary to defer resolving the 'typeattribute' until after symbols have been linked.
Ok - now I'm really confused. They typeattribute statement just references strings. Whether they are valid simply depends on whether the symbols are in scope and of the appropriate type.
I'm happy to take suggestions, but honestly, I'm not clear on what you are trying to suggest.
Karl
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.