@@ -93,8 +93,7 @@ static inline aa_state_t match_component(struct aa_profile *profile,
9393 struct aa_profile * tp ,
9494 bool stack , aa_state_t state )
9595{
96- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
97- typeof (* rules ), list );
96+ struct aa_ruleset * rules = profile -> label .rules [0 ];
9897 const char * ns_name ;
9998
10099 if (stack )
@@ -131,8 +130,7 @@ static int label_compound_match(struct aa_profile *profile,
131130 aa_state_t state , bool subns , u32 request ,
132131 struct aa_perms * perms )
133132{
134- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
135- typeof (* rules ), list );
133+ struct aa_ruleset * rules = profile -> label .rules [0 ];
136134 struct aa_profile * tp ;
137135 struct label_it i ;
138136 struct path_cond cond = { };
@@ -194,8 +192,7 @@ static int label_components_match(struct aa_profile *profile,
194192 aa_state_t start , bool subns , u32 request ,
195193 struct aa_perms * perms )
196194{
197- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
198- typeof (* rules ), list );
195+ struct aa_ruleset * rules = profile -> label .rules [0 ];
199196 struct aa_profile * tp ;
200197 struct label_it i ;
201198 struct aa_perms tmp ;
@@ -520,8 +517,7 @@ static const char *next_name(int xtype, const char *name)
520517struct aa_label * x_table_lookup (struct aa_profile * profile , u32 xindex ,
521518 const char * * name )
522519{
523- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
524- typeof (* rules ), list );
520+ struct aa_ruleset * rules = profile -> label .rules [0 ];
525521 struct aa_label * label = NULL ;
526522 u32 xtype = xindex & AA_X_TYPE_MASK ;
527523 int index = xindex & AA_X_INDEX_MASK ;
@@ -575,8 +571,6 @@ static struct aa_label *x_to_label(struct aa_profile *profile,
575571 const char * * lookupname ,
576572 const char * * info )
577573{
578- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
579- typeof (* rules ), list );
580574 struct aa_label * new = NULL ;
581575 struct aa_label * stack = NULL ;
582576 struct aa_ns * ns = profile -> ns ;
@@ -668,8 +662,7 @@ static struct aa_label *profile_transition(const struct cred *subj_cred,
668662 char * buffer , struct path_cond * cond ,
669663 bool * secure_exec )
670664{
671- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
672- typeof (* rules ), list );
665+ struct aa_ruleset * rules = profile -> label .rules [0 ];
673666 struct aa_label * new = NULL ;
674667 struct aa_profile * new_profile = NULL ;
675668 const char * info = NULL , * name = NULL , * target = NULL ;
@@ -802,8 +795,7 @@ static int profile_onexec(const struct cred *subj_cred,
802795 char * buffer , struct path_cond * cond ,
803796 bool * secure_exec )
804797{
805- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
806- typeof (* rules ), list );
798+ struct aa_ruleset * rules = profile -> label .rules [0 ];
807799 aa_state_t state = rules -> file -> start [AA_CLASS_FILE ];
808800 struct aa_perms perms = {};
809801 const char * xname = NULL , * info = "change_profile onexec" ;
@@ -1361,8 +1353,7 @@ static int change_profile_perms_wrapper(const char *op, const char *name,
13611353 struct aa_label * target , bool stack ,
13621354 u32 request , struct aa_perms * perms )
13631355{
1364- struct aa_ruleset * rules = list_first_entry (& profile -> rules ,
1365- typeof (* rules ), list );
1356+ struct aa_ruleset * rules = profile -> label .rules [0 ];
13661357 const char * info = NULL ;
13671358 int error = 0 ;
13681359
0 commit comments