~ubuntu-branches/ubuntu/trusty/apparmor/trusty

« back to all changes in this revision

Viewing changes to debian/patches/0078-parser-check-for-dbus-kernel-support.patch

  • Committer: Package Import Robot
  • Author(s): Tyler Hicks, Tyler Hicks, Jamie Strandboge, Chad Miller
  • Date: 2013-11-04 15:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20131104155730-r9d5d0ifihotcba0
Tags: 2.8.0-0ubuntu34
[ Tyler Hicks ]
* 0078-parser-check-for-dbus-kernel-support.patch: The parser should not
  include D-Bus rules in the binary policy that it loads into the kernel if
  the kernel does not support D-Bus rules (LP: #1231778)
* 0079-utils-ignore-unsupported-log-events.patch: aa-logprof should ignore
  audit events that it does not yet support instead of treating them as
  errors (LP: #1243932)
* 0080-tests-use-ldconfig-for-library-detection.patch: Fix libapparmor
  detection in regression tests after the multiarch changes

[ Jamie Strandboge ]
* 0081-python-abstraction-updates.patch: Add rules in support of Python 3.3

[ Chad Miller ]
* debian/patches/0001-add-chromium-browser.patch: Follow new chromium-browser
  sandbox name.  Keep old name for now to allow transition. LP: #1247269

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Check for kernel support prior to processing dbus entries
 
2
 .
 
3
 When a parser that is aware of dbus rules is running under a kernel
 
4
 that is unaware of dbus rules, the parser should ignore the dbus rules
 
5
 instead of attempting to load them into the kernel. Otherwise, the
 
6
 kernel will reject the entire profile, leaving the application
 
7
 unconfined.
 
8
 .
 
9
 Similar to what is done for mount rules, the features listed in
 
10
 apparmorfs should be checked to see if dbus is supported under the
 
11
 current kernel.
 
12
 .
 
13
 Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
 
14
 Acked-by: John Johansen <john.johansen@canonical.com>
 
15
Origin: backport, revision id: tyhicks@canonical.com-20131030000323-s9gvhv02e5b83lml
 
16
Author: Tyler Hicks <tyhicks@canonical.com>
 
17
Bug: https://launchpad.net/bugs/1231778
 
18
Last-Update: 2013-10-30
 
19
X-Bzr-Revision-Id: tyhicks@canonical.com-20131030000323-s9gvhv02e5b83lml
 
20
 
 
21
Index: apparmor-2.8.0/parser/parser.h
 
22
===================================================================
 
23
--- apparmor-2.8.0.orig/parser/parser.h 2013-10-29 17:11:21.018325063 -0700
 
24
+++ apparmor-2.8.0/parser/parser.h      2013-10-29 17:11:20.998325063 -0700
 
25
@@ -268,6 +268,7 @@ extern int net_af_max_override;
 
26
 extern int kernel_load;
 
27
 extern int kernel_supports_network;
 
28
 extern int kernel_supports_mount;
 
29
+extern int kernel_supports_dbus;
 
30
 extern int flag_changehat_version;
 
31
 extern int conf_verbose;
 
32
 extern int conf_quiet;
 
33
Index: apparmor-2.8.0/parser/parser_common.c
 
34
===================================================================
 
35
--- apparmor-2.8.0.orig/parser/parser_common.c  2013-10-29 17:11:21.018325063 -0700
 
36
+++ apparmor-2.8.0/parser/parser_common.c       2013-10-29 17:11:21.002325063 -0700
 
37
@@ -28,6 +28,7 @@ int net_af_max_override = -1;
 
38
 int kernel_load = 1;
 
39
 int kernel_supports_network = 1;        /* kernel supports network rules */
 
40
 int kernel_supports_mount = 0;         /* kernel supports mount rules */
 
41
+int kernel_supports_dbus = 0;          /* kernel supports dbus rules */
 
42
 int flag_changehat_version = FLAG_CHANGEHAT_1_5;
 
43
 int conf_verbose = 0;
 
44
 int conf_quiet = 0;
 
45
Index: apparmor-2.8.0/parser/parser_main.c
 
46
===================================================================
 
47
--- apparmor-2.8.0.orig/parser/parser_main.c    2013-10-29 17:11:21.018325063 -0700
 
48
+++ apparmor-2.8.0/parser/parser_main.c 2013-10-29 17:11:21.006325063 -0700
 
49
@@ -805,6 +805,8 @@ static void get_match_string(void) {
 
50
                        kernel_supports_network = 0;
 
51
                if (strstr(flags_string, "mount"))
 
52
                        kernel_supports_mount = 1;
 
53
+               if (strstr(flags_string, "dbus"))
 
54
+                       kernel_supports_dbus = 1;
 
55
                return;
 
56
        }
 
57
 
 
58
Index: apparmor-2.8.0/parser/parser_regex.c
 
59
===================================================================
 
60
--- apparmor-2.8.0.orig/parser/parser_regex.c   2013-10-29 17:11:21.018325063 -0700
 
61
+++ apparmor-2.8.0/parser/parser_regex.c        2013-10-29 18:08:00.790308545 -0700
 
62
@@ -1172,15 +1172,19 @@ static int post_process_mnt_ents(struct
 
63
 static int post_process_dbus_ents(struct codomain *cod)
 
64
 {
 
65
        int ret = TRUE;
 
66
-       struct dbus_entry *entry;
 
67
        int count = 0;
 
68
 
 
69
-       list_for_each(cod->dbus_ents, entry) {
 
70
-               if (regex_type == AARE_DFA &&
 
71
-                   !process_dbus_entry(cod->policy_rules, entry))
 
72
-                       ret = FALSE;
 
73
-               count++;
 
74
-       }
 
75
+       if (cod->dbus_ents && kernel_supports_dbus) {
 
76
+               struct dbus_entry *entry;
 
77
+
 
78
+               list_for_each(cod->dbus_ents, entry) {
 
79
+                       if (regex_type == AARE_DFA &&
 
80
+                           !process_dbus_entry(cod->policy_rules, entry))
 
81
+                               ret = FALSE;
 
82
+                       count++;
 
83
+               }
 
84
+       } else if (cod->dbus_ents && !kernel_supports_dbus)
 
85
+               pwarn("profile %s dbus rules not enforced\n", cod->name);
 
86
 
 
87
        cod->policy_rule_count += count;
 
88
        return ret;