~apparmor-dev/apparmor/master

« back to all changes in this revision

Viewing changes to kernel-patches/4.7/0024-apparmor-Fix-quieting-of-audit-messages-for-network-.patch

  • Committer: Steve Beattie
  • Date: 2019-02-19 09:38:13 UTC
  • Revision ID: sbeattie@ubuntu.com-20190219093813-ud526ee6hwn8nljz
The AppArmor project has been converted to git and is now hosted on
gitlab.

To get the converted repository, please do
  git clone https://gitlab.com/apparmor/apparmor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 64c5e24470a219c79c2870c63f18f6bd55648b1b Mon Sep 17 00:00:00 2001
2
 
From: John Johansen <john.johansen@canonical.com>
3
 
Date: Fri, 29 Jun 2012 17:34:00 -0700
4
 
Subject: [PATCH 24/25] apparmor: Fix quieting of audit messages for network
5
 
 mediation
6
 
 
7
 
If a profile specified a quieting of network denials for a given rule by
8
 
either the quiet or deny rule qualifiers, the resultant quiet mask for
9
 
denied requests was applied incorrectly, resulting in two potential bugs.
10
 
1. The misapplied quiet mask would prevent denials from being correctly
11
 
   tested against the kill mask/mode. Thus network access requests that
12
 
   should have resulted in the application being killed did not.
13
 
 
14
 
2. The actual quieting of the denied network request was not being applied.
15
 
   This would result in network rejections always being logged even when
16
 
   they had been specifically marked as quieted.
17
 
 
18
 
Signed-off-by: John Johansen <john.johansen@canonical.com>
19
 
---
20
 
 security/apparmor/net.c | 2 +-
21
 
 1 file changed, 1 insertion(+), 1 deletion(-)
22
 
 
23
 
diff --git a/security/apparmor/net.c b/security/apparmor/net.c
24
 
index 003dd18..6e6e5c9 100644
25
 
--- a/security/apparmor/net.c
26
 
+++ b/security/apparmor/net.c
27
 
@@ -88,7 +88,7 @@ static int audit_net(struct aa_profile *profile, int op, u16 family, int type,
28
 
        } else {
29
 
                u16 quiet_mask = profile->net.quiet[sa.u.net->family];
30
 
                u16 kill_mask = 0;
31
 
-               u16 denied = (1 << sa.aad->net.type) & ~quiet_mask;
32
 
+               u16 denied = (1 << sa.aad->net.type);
33
 
 
34
 
                if (denied & kill_mask)
35
 
                        audit_type = AUDIT_APPARMOR_KILL;
36
 
2.7.4
37