Commit cb38c4bf authored by John Johansen's avatar John Johansen Committed by Kamal Mostafa

UBUNTU: SAUCE: apparmor: Fix auditing behavior for change_hat probing

change_hat using probing to find and transition to the first available
hat. Hats missing as part of this probe are expected and should not
be logged except in complain mode.

BugLink: http://bugs.launchpad.net/bugs/1615893Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Acked-by: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 5de0db72
...@@ -931,12 +931,20 @@ static struct aa_label *change_hat(struct aa_label *label, const char *hats[], ...@@ -931,12 +931,20 @@ static struct aa_label *change_hat(struct aa_label *label, const char *hats[],
error = -ECHILD; error = -ECHILD;
fail: fail:
fn_for_each_in_ns(label, profile, label_for_each_in_ns(it, labels_ns(label), label, profile) {
/* no target as it has failed to be found or built */ /*
* no target as it has failed to be found or built
*
* change_hat uses probing and should not log failures
* related to missing hats
*/
/* TODO: get rid of GLOBAL_ROOT_UID */ /* TODO: get rid of GLOBAL_ROOT_UID */
aa_audit_file(profile, &nullperms, OP_CHANGE_HAT, if (count > 1 || COMPLAIN_MODE(profile)) {
AA_MAY_CHANGEHAT, name, NULL, NULL, aa_audit_file(profile, &nullperms, OP_CHANGE_HAT,
GLOBAL_ROOT_UID, info, error)); AA_MAY_CHANGEHAT, name, NULL, NULL,
GLOBAL_ROOT_UID, info, error);
}
}
return (ERR_PTR(error)); return (ERR_PTR(error));
build: build:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment