patch: disallow policy from declaring the type 'self'
Recently we noticed that one may declare a type named "self". The following patch disallows the policy from doing this. checkpolicy/checkmodule will treat "self" as a reserved word.
NOTE: This patch in no way affects the use of "self" as the target within AV rules.
module_compiler.c-new renamed from module_compiler.c +2 -0
@@ -262,6 +262,10 @@ type_datum_t *declare_type(unsigned char yyerror("no type/attribute name?"); return NULL; } + if (strcmp(id, "self") == 0) { + yyerror("'self' is a reserved type name and may not be
declared.");
+ return NULL;
+ }
typdatum = (type_datum_t *) malloc(sizeof(type_datum_t)); if (!typdatum) {
Signature · 7 lines
Jason Tang / [email protected] -- 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.