]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - debian/patches/06_apparmor_chromium_updates.patch
* debian/patches/06_apparmor_chromium_updates.patch: allow oxide based
[sojka/lightdm.git] / debian / patches / 06_apparmor_chromium_updates.patch
1 Author: Jamie Strandboge <jamie@canonical.com>
2 Description: allow oxide based browsers and Google Chrome to run in the guest
3  session
4 Bug-Ubuntu: https://launchpad.net/bugs/1298021
5 Bug-Ubuntu: https://launchpad.net/bugs/1306560
6
7 Index: lightdm-1.10.0/data/apparmor/abstractions/lightdm_chromium-browser
8 ===================================================================
9 --- lightdm-1.10.0.orig/data/apparmor/abstractions/lightdm_chromium-browser     2014-04-11 10:57:59.566526276 -0500
10 +++ lightdm-1.10.0/data/apparmor/abstractions/lightdm_chromium-browser  2014-04-11 10:58:17.026755558 -0500
11 @@ -1,15 +1,28 @@
12  # vim:syntax=apparmor
13 -# Profile abstraction for restricting chromium-browser in the lightdm guest session
14 +# Profile abstraction for restricting chromium in the lightdm guest session
15  # Author: Jamie Strandboge <jamie@canonical.com>
16  
17  # The abstraction provides the additional accesses required to launch
18 -# chromium-browser from within an lightdm session. Because AppArmor cannot yet
19 -# merge profiles and because we want to utilize the access rules provided in
20 -# abstractions/lightdm, this abstraction must be separate from
21 +# chromium based browsers from within an lightdm session. Because AppArmor
22 +# cannot yet merge profiles and because we want to utilize the access rules
23 +# provided in abstractions/lightdm, this abstraction must be separate from
24  # abstractions/lightdm.
25  
26 -  /usr/lib/chromium-browser/chromium-browser Cx -> chromium_browser,
27 -  profile chromium_browser {
28 +  /usr/lib/chromium-browser/chromium-browser Cx -> chromium,
29 +  /usr/bin/webapp-container Cx -> chromium,
30 +  /usr/bin/webbrowser-app Cx -> chromium,
31 +  /usr/bin/ubuntu-html5-app-launcher Cx -> chromium,
32 +  /opt/google/chrome-stable/google-chrome-stable Cx -> chromium,
33 +  /opt/google/chrome-beta/google-chrome-beta Cx -> chromium,
34 +  /opt/google/chrome-unstable/google-chrome-unstable Cx -> chromium,
35 +
36 +  # Allow ptracing processes in the chromium child profile
37 +  ptrace peer=/usr/lib/lightdm/lightdm-guest-session//chromium,
38 +
39 +  # Allow receiving and sending signals to processes in the chromium child profile
40 +  signal (receive, send) peer=/usr/lib/lightdm/lightdm-guest-session//chromium,
41 +
42 +  profile chromium {
43      # Allow all the same accesses as other applications in the guest session
44      #include <abstractions/lightdm>
45  
46 @@ -22,6 +35,17 @@
47      capability setgid,     # for sandbox to drop privileges
48      capability setuid,     # for sandbox to drop privileges
49      capability sys_ptrace, # chromium needs this to keep track of itself
50 +    @{PROC}/sys/kernel/yama/ptrace_scope r,
51 +
52 +    # Allow ptrace reads of processes in the lightdm-guest-session
53 +    ptrace (read) peer=/usr/lib/lightdm/lightdm-guest-session,
54 +    # Allow other guest session processes to read and trace us
55 +    ptrace (readby, tracedby) peer=/usr/lib/lightdm/lightdm-guest-session,
56 +    ptrace (readby, tracedby) peer=@{profile_name},
57 +
58 +    # Allow us to receive and send signals from processes in the
59 +    # lightdm-guest-session
60 +    signal (receive, send) set=("exists") peer=/usr/lib/lightdm/lightdm-guest-session,
61  
62      @{PROC}/[0-9]*/ r,                 # sandbox wants these
63      @{PROC}/[0-9]*/fd/ r,              # sandbox wants these
64 @@ -30,4 +54,6 @@
65      /selinux/ r,
66  
67      /usr/lib/chromium-browser/chromium-browser-sandbox ix,
68 +    /usr/lib/@{multiarch}/oxide-qt/chrome-sandbox ix,
69 +    /opt/google/chrome-*/chrome-sandbox ix,
70    }