Skip to content

Commit

Permalink
AppArmor: fix mapping of META_READ to audit and quiet flags
Browse files Browse the repository at this point in the history
The mapping of AA_MAY_META_READ for the allow mask was also being mapped
to the audit and quiet masks. This would result in some operations being
audited when the should not.

This flaw was hidden by the previous audit bug which would drop some
messages that where supposed to be audited.

Signed-off-by: John Johansen <[email protected]>
Acked-by: Kees Cook <[email protected]>
  • Loading branch information
John Johansen committed Feb 27, 2012
1 parent 8b964ea commit 38305a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions security/apparmor/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ static u32 map_old_perms(u32 old)
if (old & 0x40) /* AA_EXEC_MMAP */
new |= AA_EXEC_MMAP;

new |= AA_MAY_META_READ;

return new;
}

Expand Down Expand Up @@ -212,6 +210,7 @@ static struct file_perms compute_perms(struct aa_dfa *dfa, unsigned int state,
perms.quiet = map_old_perms(dfa_other_quiet(dfa, state));
perms.xindex = dfa_other_xindex(dfa, state);
}
perms.allow |= AA_MAY_META_READ;

/* change_profile wasn't determined by ownership in old mapping */
if (ACCEPT_TABLE(dfa)[state] & 0x80000000)
Expand Down

0 comments on commit 38305a4

Please sign in to comment.