From: John Johansen Date: Mon, 18 Feb 2013 23:59:34 +0000 (-0800) Subject: apparmor: fix auditing of domain transition failures due to incomplete policy X-Git-Tag: v3.11-rc1~103^2~13^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=17322cc3f9ba578f20b5c09fb1630bd234040008;p=profile%2Fivi%2Fkernel-x86-ivi.git apparmor: fix auditing of domain transition failures due to incomplete policy When policy specifies a transition to a profile that is not currently loaded, it result in exec being denied. However the failure is not being audited correctly because the audit code is treating this as an allowed permission and thus not reporting it. Signed-off-by: John Johansen Acked-By: Steve Beattie --- diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index 859abda..7bc85c7 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -443,6 +443,8 @@ int apparmor_bprm_set_creds(struct linux_binprm *bprm) } else { error = -ENOENT; info = "profile not found"; + /* remove MAY_EXEC to audit as failure */ + perms.allow &= ~MAY_EXEC; } } } else if (COMPLAIN_MODE(profile)) {