Skip to content

Commit 16916b1

Browse files
rlee287jrjohansen
authored andcommitted
apparmor: force auditing of conflicting attachment execs from confined
Conflicting attachment paths are an error state that result in the binary in question executing under an unexpected ix/ux fallback. As such, it should be audited to record the occurrence of conflicting attachments. Signed-off-by: Ryan Lee <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent b824b5f commit 16916b1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

security/apparmor/domain.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,15 @@ static struct aa_label *profile_transition(const struct cred *subj_cred,
729729
new = x_to_label(profile, bprm, name, perms.xindex, &target,
730730
&info);
731731
if (new && new->proxy == profile->label.proxy && info) {
732+
/* Force audit on conflicting attachment fallback
733+
* Because perms is never used again after this audit
734+
* we don't need to care about clobbering it
735+
*/
736+
if (info == CONFLICTING_ATTACH_STR_IX
737+
|| info == CONFLICTING_ATTACH_STR_UX) {
738+
perms.audit |= MAY_EXEC;
739+
perms.allow |= MAY_EXEC;
740+
}
732741
/* hack ix fallback - improve how this is detected */
733742
goto audit;
734743
} else if (!new) {

0 commit comments

Comments
 (0)