@@ -826,33 +826,19 @@ static struct aa_label *handle_onexec(const struct cred *subj_cred,
826
826
AA_BUG (!bprm );
827
827
AA_BUG (!buffer );
828
828
829
- if (!stack ) {
830
- error = fn_for_each_in_ns (label , profile ,
831
- profile_onexec (subj_cred , profile , onexec , stack ,
832
- bprm , buffer , cond , unsafe ));
833
- if (error )
834
- return ERR_PTR (error );
835
- new = fn_label_build_in_ns (label , profile , GFP_KERNEL ,
836
- aa_get_newest_label (onexec ),
837
- profile_transition (subj_cred , profile , bprm ,
838
- buffer ,
839
- cond , unsafe ));
840
-
841
- } else {
842
- /* TODO: determine how much we want to loosen this */
843
- error = fn_for_each_in_ns (label , profile ,
844
- profile_onexec (subj_cred , profile , onexec , stack , bprm ,
845
- buffer , cond , unsafe ));
846
- if (error )
847
- return ERR_PTR (error );
848
- new = fn_label_build_in_ns (label , profile , GFP_KERNEL ,
849
- aa_label_merge (& profile -> label , onexec ,
850
- GFP_KERNEL ),
851
- profile_transition (subj_cred , profile , bprm ,
852
- buffer ,
853
- cond , unsafe ));
854
- }
829
+ /* TODO: determine how much we want to loosen this */
830
+ error = fn_for_each_in_ns (label , profile ,
831
+ profile_onexec (subj_cred , profile , onexec , stack ,
832
+ bprm , buffer , cond , unsafe ));
833
+ if (error )
834
+ return ERR_PTR (error );
855
835
836
+ new = fn_label_build_in_ns (label , profile , GFP_KERNEL ,
837
+ stack ? aa_label_merge (& profile -> label , onexec ,
838
+ GFP_KERNEL )
839
+ : aa_get_newest_label (onexec ),
840
+ profile_transition (subj_cred , profile , bprm ,
841
+ buffer , cond , unsafe ));
856
842
if (new )
857
843
return new ;
858
844
0 commit comments