firefox apparmor messages

Bug #1861408 reported by dinar qurbanov
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
apparmor (Ubuntu)
Confirmed
Undecided
Unassigned
firefox (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

firefox version 72.0.1 64 bit, 72.0.1+linuxmint1+tricia , linux mint 19.3.

i see there is newer ubuntu version in https://www.ubuntuupdates.org/package/ubuntu_mozilla_security/bionic/main/base/firefox , 72.0.2+build1-0ubuntu0.18.04.1 , but its changes are not for apparmor.

i have not found a page for firefox bugs in linux mint sites, so i belive i should report here. but i have also asked about that in linux mint's irc and then github.

i have enabled apparmor for firefox and see these types of messages in syslog:

Jan 28 18:43:33 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[735]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.111' (uid=1000 pid=1922 comm="/usr/lib/firefox/firefox " label="unconfined")

Jan 28 18:44:36 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 5525.077960] audit: type=1400 audit(1580226276.440:27): apparmor="DENIED" operation="capable" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" pid=15948 comm="firefox" capability=21 capname="sys_admin"

Jan 28 18:44:37 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 5526.471731] audit: type=1107 audit(1580226277.832:28): pid=735 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/RealtimeKit1" interface="org.freedesktop.DBus.Properties" member="Get" mask="send" name="org.freedesktop.RealtimeKit1" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1320 peer_label="unconfined"

Jan 28 18:44:47 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1181]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gtk/vfs/Daemon" interface="org.gtk.vfs.Daemon" member="ListMonitorImplementations" mask="send" name=":1.10" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1262 peer_label="unconfined"

Jan 28 18:44:47 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1181]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gtk/Private/RemoteVolumeMonitor" interface="org.gtk.Private.RemoteVolumeMonitor" member="IsSupported" mask="send" name=":1.35" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1385 peer_label="unconfined"

Jan 28 18:44:47 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1181]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gtk/vfs/mounttracker" interface="org.gtk.vfs.MountTracker" member="ListMounts2" mask="send" name=":1.10" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1262 peer_label="unconfined"

Jan 28 18:44:47 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1181]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gtk/vfs/mounttracker" interface="org.gtk.vfs.MountTracker" member="LookupMount" mask="send" name=":1.10" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1262 peer_label="unconfined"

Jan 28 18:44:48 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[735]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.119' (uid=1000 pid=15948 comm="/usr/lib/firefox/firefox " label="/usr/lib/firefox/firefox{,*[^s][^h]} (enforce)")

Jan 28 18:44:48 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 5536.783313] audit: type=1107 audit(1580226288.143:34): pid=735 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/hostname1" interface="org.freedesktop.DBus.Properties" member="GetAll" mask="send" name=":1.120" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=16177 peer_label="unconfined"

Jan 28 18:45:02 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1181]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/ca/desrt/dconf/Writer/user" interface="ca.desrt.dconf.Writer" member="Change" mask="send" name="ca.desrt.dconf" pid=15948 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1370 peer_label="unconfined"

Jan 28 21:51:30 dinar-HP-Pavilion-g7-Notebook-PC kernel: [10131.880788] audit: type=1400 audit(1580237490.777:123): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.cache/mesa_shader_cache/index" pid=19720 comm="firefox" requested_mask="wrc" denied_mask="wrc" fsuid=1000 ouid=1000

these appeared while saving a file:

Jan 30 11:08:28 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1151]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/ca/desrt/dconf/Writer/user" interface="ca.desrt.dconf.Writer" member="Change" mask="send" name="ca.desrt.dconf" pid=1584 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1301 peer_label="unconfined"

Jan 30 11:08:28 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 464.049675] audit: type=1400 audit(1580371708.871:38): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.local/share/gvfs-metadata/home" pid=1584 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

these appeared while runned "firefox -p":

Jan 30 11:41:23 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[1151]: apparmor="DENIED" operation="dbus_signal" bus="session" path="/ca/desrt/dconf/Writer/user" interface="ca.desrt.dconf.Writer" member="Notify" name=":1.21" mask="receive" pid=1584 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1301 peer_label="unconfined"

Jan 30 11:42:07 dinar-HP-Pavilion-g7-Notebook-PC dbus-daemon[762]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.90' (uid=1000 pid=2892 comm="xed /home/dinar/?????????????? ????????/??????????" label="unconfined")

Revision history for this message
dinar qurbanov (qdinar) wrote :

i have installed linux mint on another comp and this time i enabled ff apparmor profile before first run of ff.

now, i get also these messages, every time a page/url is opened/loaded:

Feb 3 18:40:24 dinar-Lenovo-G580 dbus-daemon[1307]: apparmor="DENIED" operation="dbus_method_call" bus="session" path="/org/gtk/vfs/Daemon" interface="org.gtk.vfs.Daemon" member="ListMonitorImplementations" mask="send" name=":1.6" pid=4668 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1368 peer_label="unconfined"
Feb 3 18:40:24 dinar-Lenovo-G580 kernel: [ 4131.097714] audit: type=1400 audit(1580744424.242:117): apparmor="DENIED" operation="mkdir" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.cache/fontconfig/" pid=4668 comm=57656220436F6E74656E74 requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
Feb 3 18:40:24 dinar-Lenovo-G580 kernel: [ 4131.097721] audit: type=1400 audit(1580744424.242:118): apparmor="DENIED" operation="mkdir" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.fontconfig/" pid=4668 comm=57656220436F6E74656E74 requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000
Feb 3 18:40:24 dinar-Lenovo-G580 kernel: [ 4131.162558] audit: type=1107 audit(1580744424.306:119): pid=767 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/RealtimeKit1" interface="org.freedesktop.DBus.Properties" member="Get" mask="send" name="org.freedesktop.RealtimeKit1" pid=4668 label="/usr/lib/firefox/firefox{,*[^s][^h]}" peer_pid=1521 peer_label="unconfined"
Feb 3 18:40:24 dinar-Lenovo-G580 kernel: [ 4131.162558] exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'

on first run of firefox, there were, in addition to the above shown types, this type:

Feb 3 18:06:58 dinar-Lenovo-G580 kernel: [ 2125.679905] audit: type=1400 audit(1580742418.752:43): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.config/dconf/user" pid=3288 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Revision history for this message
dinar qurbanov (qdinar) wrote :

i have simplified all of these messages, i hope this is helpful:
sys_admin
dbus_method_call path="/org/freedesktop/RealtimeKit1" member="Get" name="org.freedesktop.RealtimeKit1"
dbus_method_call path="/org/gtk/vfs/Daemon" member="ListMonitorImplementations"
dbus_method_call path="/org/gtk/Private/RemoteVolumeMonitor" member="IsSupported"
dbus_method_call path="/org/gtk/vfs/mounttracker" member="ListMounts2"
dbus_method_call member="LookupMount"
dbus_method_call path="/org/freedesktop/hostname1" member="GetAll"
dbus_method_call path="/ca/desrt/dconf/Writer/user" member="Change" name="ca.desrt.dconf"
open name="/home/dinar/.cache/mesa_shader_cache/index" requested_mask="wrc" denied_mask="wrc"
open name="/home/dinar/.local/share/gvfs-metadata/home" requested_mask="r" denied_mask="r"
dbus_signal path="/ca/desrt/dconf/Writer/user" interface="ca.desrt.dconf.Writer" member="Notify"
mkdir name="/home/dinar/.cache/fontconfig/" requested_mask="c" denied_mask="c"
mkdir name="/home/dinar/fontconfig/" requested_mask="c" denied_mask="c"
open name="/home/dinar/.config/dconf/user" requested_mask="r" denied_mask="r"

dinar qurbanov (qdinar)
affects: firefox (Ubuntu) → apparmor (Ubuntu)
Revision history for this message
dinar qurbanov (qdinar) wrote :

i modified /etc/apparmor.d/abstractions/fonts by adding w to
owner @{HOME}/.{,cache/}fontconfig/ r,
and replaced ff apparmor profile with "sudo apparmor_parser -r -T -W /etc/apparmor.d/usr.bin.firefox".
then i tried to open a page, and i got these:

Feb 3 21:26:26 dinar-Lenovo-G580 kernel: [14092.695137] audit: type=1400 audit(1580754386.268:292): apparmor="DENIED" operation="mknod" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.cache/fontconfig/CACHEDIR.TAG.TMP-ZjyBns" pid=8547 comm=57656220436F6E74656E74 requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000

Feb 3 21:26:26 dinar-Lenovo-G580 kernel: [14092.695143] audit: type=1400 audit(1580754386.268:293): apparmor="DENIED" operation="mknod" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.cache/fontconfig/a41116dafaf8b233ac2c61cb73f2ea5f-le64.cache-7.TMP-6nwuBp" pid=8547 comm=57656220436F6E74656E74 requested_mask="c" denied_mask="c" fsuid=1000 ouid=1000

Revision history for this message
dinar qurbanov (qdinar) wrote :

i added w to
owner @{HOME}/.{,cache/}fontconfig/** mrl,
in /etc/apparmor.d/abstractions/fonts
and after profile replace, frequent messages stopped.

Revision history for this message
dinar qurbanov (qdinar) wrote :

i think

Jan 30 11:08:28 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 464.049675] audit: type=1400 audit(1580371708.871:38): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/home/dinar/.local/share/gvfs-metadata/home" pid=1584 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

message, which appear while saving files, was caused by my edition. i am sorry.

i edited /etc/apparmor.d/abstractions/ubuntu-browsers.d/user-files
this way:

i commented out

@{HOME}/** r,
owner @{HOME}/** w,

and have added

@{HOME}/Общедоступные/** r,
owner @{HOME}/Загрузки/** rwk,

Revision history for this message
dinar qurbanov (qdinar) wrote :

i have added these lines:

in /etc/apparmor.d/abstractions/gnome :

@{HOME}/.local/share/gvfs-metadata/** r,

in /etc/apparmor.d/abstractions/xdg-desktop :

owner @{HOME}/.cache/mesa_shader_cache/** rw,

and messages (i use aa-notify) when saving disappeared.

dbus_method_call messages still appear in logs, while saving. i do not know why they are not reported by aa-notify.

Revision history for this message
dinar qurbanov (qdinar) wrote :

i asked about sys_admin capability and got some answers: https://groups.google.com/forum/#!topic/mozilla.dev.platform/UK4nm7MtTxQ

(i wanted to ask in firefox-dev mailing list but the dev-platform list was said about as more appropriate).

Revision history for this message
John Johansen (jjohansen) wrote :

Firefox uses cap sys_admin to set up its sandbox, which is extremely unfortunate but required on linux to be able to set up the user_namespace, do the chroot etc. Current the LSM and user namespaces don't interact as well as they should.

AppArmor can NOT properly determine the policy namespace that it should be in with the user_namespace after firefox enters its sandbox. This result in the cap_sys admin messages

This is a known problem and we are working on it. At the moment we recommend granting the capability in the profile and letting firefox setup its sandbox. Unfortunately this means you can't guarantee the rest of the program isn't doing things it shouldn't.

Revision history for this message
John Johansen (jjohansen) wrote :

I should further note that this needs kernel patches to be fixed.

Revision history for this message
dinar qurbanov (qdinar) wrote :

>At the moment we recommend granting the capability in the profile and letting firefox setup its sandbox.

why do not ubuntu developers add it? (before they make it other way.)

>Unfortunately this means you can't guarantee the rest of the program isn't doing things it shouldn't.

what it can do using this capability, without using any other additional apparmor allow rules? can you give any examples?

Revision history for this message
dinar qurbanov (qdinar) wrote :

i added these lines to ff profile:

#copied from abstractions/lightdm_chromium-browser
    capability sys_admin, # for sandbox to change namespaces
    capability sys_chroot, # fod sandbox to chroot to a safe directory
    capability setgid, # for sandbox to drop privileges
    capability setuid, # for sandbox to drop privileges
    capability sys_ptrace, # chromium needs this to keep track of itself

Revision history for this message
dinar qurbanov (qdinar) wrote :

i have some questions and wishes about rules that are in the profile:

  # so browsing directories works
  / r,
  /**/ r,

what if comment these out and allow / and owner @{HOME}/** , instead of these? does firefox need other directory listings? maybe i will try.

i see /usr/ r, /etc/ r, /opt/ r, @{PROC}/ r, /usr/bin/ r, are already allowed, why are these used? i would like to see there comments, in the profile.

  # Default profile allows downloads to ~/Downloads and uploads from ~/Public
  owner @{HOME}/ r,
  owner @{HOME}/Public/ r,
  owner @{HOME}/Public/* r,
  owner @{HOME}/Downloads/ r,
  owner @{HOME}/Downloads/* rw,

are not you going to put there all language variants?

Revision history for this message
dinar qurbanov (qdinar) wrote :

also there are /sys/devices/system/cpu/ r,
  /etc/firefox*/ r,
  /etc/xulrunner-2.0*/ r,
  /etc/gre.d/ r,

Revision history for this message
dinar qurbanov (qdinar) wrote :
Download full text (4.5 KiB)

after firefox restart these appeared:

Feb 24 09:30:04 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 141.932834] audit: type=1400 audit(1582525804.452:27): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/proc/1888/uid_map" pid=1888 comm=495043204C61756E6368202331 requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
Feb 24 09:30:04 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 141.934780] IPC Launch #1[1888]: segfault at 0 ip 00007fa9fe84808c sp 00007fa9f0efa780 error 6 in libxul.so[7fa9fdfac000+6f21000]
Feb 24 09:30:04 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 141.934798] Code: 75 12 89 e8 48 81 c4 10 02 00 00 5b 41 5c 41 5e 41 5f 5d c3 e8 f5 bb fc ff 48 8d 05 ae 89 85 04 48 8b 0d 57 75 c6 06 48 89 01 <c7> 04 25 00 00 00 00 1e 02 00 00 e8 ac 4a fd ff 48 8d 05 e3 89 85
Feb 24 09:30:06 dinar-HP-Pavilion-g7-Notebook-PC wpa_supplicant[826]: wlo1: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-85 noise=-95 txrate=14400
Feb 24 09:30:10 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 148.016837] audit: type=1400 audit(1582525810.536:28): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/proc/1926/uid_map" pid=1926 comm=495043204C61756E6368202331 requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
Feb 24 09:30:10 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 148.017346] IPC Launch #1[1926]: segfault at 0 ip 00007fa9fe84808c sp 00007fa9eb29d780 error 6 in libxul.so[7fa9fdfac000+6f21000]
Feb 24 09:30:10 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 148.017359] Code: 75 12 89 e8 48 81 c4 10 02 00 00 5b 41 5c 41 5e 41 5f 5d c3 e8 f5 bb fc ff 48 8d 05 ae 89 85 04 48 8b 0d 57 75 c6 06 48 89 01 <c7> 04 25 00 00 00 00 1e 02 00 00 e8 ac 4a fd ff 48 8d 05 e3 89 85
Feb 24 09:30:11 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 148.895517] IPC Launch #1[1973]: segfault at 0 ip 00007fa9fe84808c sp 00007fa9ea5a2780 error 6 in libxul.so[7fa9fdfac000+6f21000]
Feb 24 09:30:11 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 148.895535] Code: 75 12 89 e8 48 81 c4 10 02 00 00 5b 41 5c 41 5e 41 5f 5d c3 e8 f5 bb fc ff 48 8d 05 ae 89 85 04 48 8b 0d 57 75 c6 06 48 89 01 <c7> 04 25 00 00 00 00 1e 02 00 00 e8 ac 4a fd ff 48 8d 05 e3 89 85
Feb 24 09:30:11 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 148.895594] audit: type=1400 audit(1582525811.416:29): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/proc/1973/uid_map" pid=1973 comm=495043204C61756E6368202331 requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
Feb 24 09:30:12 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 150.432287] IPC Launch #1[1991]: segfault at 0 ip 00007fa9fe84808c sp 00007fa9fba7f780 error 6 in libxul.so[7fa9fdfac000+6f21000]
Feb 24 09:30:12 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 150.432303] Code: 75 12 89 e8 48 81 c4 10 02 00 00 5b 41 5c 41 5e 41 5f 5d c3 e8 f5 bb fc ff 48 8d 05 ae 89 85 04 48 8b 0d 57 75 c6 06 48 89 01 <c7> 04 25 00 00 00 00 1e 02 00 00 e8 ac 4a fd ff 48 8d 05 e3 89 85
Feb 24 09:30:12 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 150.432405] audit: type=1400 audit(1582525812.952:30): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/proc/1...

Read more...

Revision history for this message
dinar qurbanov (qdinar) wrote :

  / r,
  /**/ r,
is not enough. because thumbnails are not shown. much better would be to use a separate program as a helper application, while it can read all files but it is very simple and can only open a file by gui mouse click, and cannot connect internet.

Revision history for this message
Seth Arnold (seth-arnold) wrote : Re: [Bug 1861408] Re: firefox apparmor messages

On Mon, Feb 24, 2020 at 06:48:33AM -0000, dinar qurbanov wrote:
> after firefox restart these appeared:
>
> Feb 24 09:30:04 dinar-HP-Pavilion-g7-Notebook-PC kernel: [ 141.932834]
> audit: type=1400 audit(1582525804.452:27): apparmor="DENIED"
> operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}"
> name="/proc/1888/uid_map" pid=1888 comm=495043204C61756E6368202331

This file is a necessary part of the Firefox sandbox code. If you deny
this but allow the syscalls and privileges that start the sandbox, you're
going to see some very unusual results.

Thanks

Revision history for this message
dinar qurbanov (qdinar) wrote :

message when switching to read mode:
Feb 26 13:13:13 dinar-HP-Pavilion-g7-Notebook-PC kernel: [64008.165294] audit: type=1400 audit(1582711993.444:302): apparmor="DENIED" operation="exec" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/usr/bin/speech-dispatcher" pid=30443 comm=7370656563686420696E6974 requested_mask="x" denied_mask="x" fsuid=1000 ouid=0

Revision history for this message
dinar qurbanov (qdinar) wrote :

i have reenabled the capability rules ans added these to them, also from the chromium profile:

    owner @{PROC}/@{pid}/setgroups w,
    owner @{PROC}/@{pid}/uid_map w,
    owner @{PROC}/@{pid}/gid_map w,
.

i have prepared dbus rules:

dbus send
    bus=system
    path=/org/freedesktop/RealtimeKit1
    interface=org.freedesktop.DBus.Properties
    member=Get
    peer=(name=org.freedesktop.RealtimeKit1|label="/usr/lib/firefox/firefox{,*[^s][^h]}")

dbus send
    bus=session
    path=/org/gtk/vfs/Daemon
    interface=org.gtk.vfs.Daemon
    member=ListMonitorImplementations
    peer=(name=":1.10" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

dbus send
    bus="session"
    path="/org/gtk/Private/RemoteVolumeMonitor"
    interface="org.gtk.Private.RemoteVolumeMonitor"
    member="IsSupported"
    peer=(name=":1.35" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

dbus send
    bus="session"
    path="/org/gtk/vfs/mounttracker"
    interface="org.gtk.vfs.MountTracker"
    member="ListMounts2"
    peer=( name=":1.10" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

dbus send
    bus="session"
    path="/org/gtk/vfs/mounttracker"
    interface="org.gtk.vfs.MountTracker"
    member="LookupMount"
    peer=( name=":1.10" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

dbus send
    bus="system"
    path="/org/freedesktop/hostname1"
    interface="org.freedesktop.DBus.Properties"
    member="GetAll"
    peer=( name=":1.120" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

dbus send
    bus="session"
    path="/ca/desrt/dconf/Writer/user"
    interface="ca.desrt.dconf.Writer"
    member="Change"
    peer=( name="ca.desrt.dconf" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

dbus receive
    bus="session"
    path="/ca/desrt/dconf/Writer/user"
    interface="ca.desrt.dconf.Writer"
    member="Notify"
    peer=( name=":1.21" | label="/usr/lib/firefox/firefox{,*[^s][^h]}" )

please somebody correct them and say to which file they should be added.

Revision history for this message
dinar qurbanov (qdinar) wrote :

what is ubuntu's policy for updating this profile? it looks like package maintainers are not updating this profile on every package update. why?

Revision history for this message
John Johansen (jjohansen) wrote :

I can not speak to specifics but there are a lot of potential reason's a packager (not firefox specific) might not be updating the profile.

- They don't use the profile / or maybe apparmor. (package maintainership evolves and not everyone who might even be aware of it without digging in)

- The auto package tests don't report a failure. This could be the tests aren't set up to use apparmor or just that they don't have a specific test for a change. Packagers are often very busy and won't dig into an update unless there are problems being reported.

- The packager can be using a different kernel version which results in apparmor or the kernel/apparmor having different features being used. Yes they should be testing on a given release but there are HWE kernels and upstream kernel builds that users may be using that are different from what the packager tests on.

- Testing didn't show up an issue, but a different config or usage pattern that a user has will show up an issue.

- The packager is not familiar with apparmor and can't or at least doesn't feel compfortable updating the profile.

- The upstream packager tries to maintain a single profile version for all releases of a package. Eg. FF 71 is released on multiple distro versions (xenial, bionic, ...) each of those distros have different kernels and the application will use different features and apparmor presents different features.

- AppArmor does not provide adequate means to distribute/use a single profile version across multiple releases when the features required are significantly different.

I am not arguing that the profile should not be updated, just providing some reasons for why it might not be. Ideally it should be tested, and updated if necessary with every release especially when the profile is part of the package.

Revision history for this message
dinar qurbanov (qdinar) wrote :
Revision history for this message
dinar qurbanov (qdinar) wrote :

to
"
i added w to
owner @{HOME}/.{,cache/}fontconfig/** mrl,
"
:

cboltz said in apparmor irc channel:

I'd recommend _not_ to allow writing to ~/.cache/fontconfig/ because apps could in theory poison that cache
actually we recently (intentionally) removed write permissions in abstractions/fonts

Revision history for this message
dinar qurbanov (qdinar) wrote :

appears when pressing ctrl+s:
Apr 17 17:13:48 dinar-comp kernel: [81128.012319] audit: type=1400 audit(1587132828.960:765): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/run/mount/utab" pid=4596 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Revision history for this message
dinar qurbanov (qdinar) wrote :

appeared when opening a file from a manually mounted partition:
May 6 14:59:12 dinar-comp kernel: [544099.237323] audit: type=1400 audit(1588766352.217:3081): apparmor="DENIED" operation="open" profile="/usr/lib/firefox/firefox{,*[^s][^h]}" name="/run/user/1000/ICEauthority" pid=6886 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

linux and firefox were upgraded, firefox profile file was changed, i copied new changes to my file.
appeared when starting firefox after system upgrade and reboot:
except dbus messages:
May 9 15:00:47 dinar-comp kernel: [ 227.464788] audit: type=1400 audit(1589025647.896:44): apparmor="DENIED" operation="open" profile="firefox" name="/run/user/1000/ICEauthority" pid=2086 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
May 9 15:00:49 dinar-comp kernel: [ 229.423946] audit: type=1400 audit(1589025649.856:45): apparmor="DENIED" operation="file_mmap" profile="firefox//lsb_release" name="/usr/bin/python3.7" pid=2115 comm="lsb_release" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

i have a local file pinned, and tabs are restored after restart, the "/run/user/1000/ICEauthority" may be because of it. (as in the may 6 message above).

appear when pressing ctrl+o:
May 9 15:23:33 dinar-comp kernel: [ 1592.754371] audit: type=1400 audit(1589027013.231:63): apparmor="DENIED" operation="open" profile="firefox" name="/home/dinar/.xsession-errors" pid=2086 comm="pool-firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
May 9 15:23:36 dinar-comp kernel: [ 1596.437062] audit: type=1400 audit(1589027016.916:65): apparmor="DENIED" operation="open" profile="firefox" name="/run/mount/utab" pid=2086 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

Revision history for this message
dinar qurbanov (qdinar) wrote :

i changed /usr/bin/python3.[0-6] mr, to /usr/bin/python3.[0-7] mr, and the python message disappeared while starting firefox.

Revision history for this message
dinar qurbanov (qdinar) wrote :

i said on feb 4:
"dbus_method_call messages still appear in logs, while saving. i do not know why they are not reported by aa-notify."
i made this report on apparmor site on march 7:
https://gitlab.com/apparmor/apparmor/-/issues/81
"aa-notify does not show messages about dbus"

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for that suggestion in comment #25 Динар, I committed the change to the apparmor profile: https://bazaar.launchpad.net/~mozillateam/firefox/firefox.groovy/revision/1388.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Olivier, is the commit enough to consider the bug fix commited?

Changed in firefox (Ubuntu):
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 76.0.1+build1-0ubuntu2

---------------
firefox (76.0.1+build1-0ubuntu2) groovy; urgency=medium

  * Update apparmor profile to allow lsb_release to run with more recent
    versions of Python 3 (LP: #1861408)
    - debian/usr.bin.firefox.apparmor.14.10
  * Work around clang hanging forever when trying to optimize the build of the
    embedded copy of sqlite3 (LP: #1878292)
    - debian/patches/s390x-workaround-sqlite3-clang-optimization-hang.patch

 -- Olivier Tilloy <email address hidden> Tue, 12 May 2020 23:11:11 +0200

Changed in firefox (Ubuntu):
status: New → Fix Released
Revision history for this message
Olivier Tilloy (osomon) wrote :

That commit/fix was only a small part of all that has been reported in this bug, and that was an opportunistic fix. I don't plan on working on the apparmor profile in the near future, unless some serious problem with it is reported (which, unless I have misread, is not the case of any of the comments in this bug report).

It doesn't hurt to keep the bug open, though.

Changed in firefox (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
dinar qurbanov (qdinar) wrote :

after update to 76.0.1, fontconfig messages started again to appear on every page opening.
i added
deny @{HOME}/.{,cache/}fontconfig/** w,
to abstractions/fonts, reloaded profile, and that notifications stopped to appear.

Revision history for this message
dinar qurbanov (qdinar) wrote :

python message after update to ubuntu 20.04 :
May 29 08:54:00 dinar-comp kernel: [ 369.424679] audit: type=1400 audit(1590731640.601:54): apparmor="DENIED" operation="file_mmap" profile="fire
fox//lsb_release" name="/usr/bin/python3.8" pid=2939 comm="lsb_release" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

there are several places about python:

  profile lsb_release {
...
    #include <abstractions/python>
...
    /usr/include/python2.[4567]/pyconfig.h r,
...
    /usr/local/lib/python3.[0-6]/dist-packages/ r,
...
    /usr/bin/python3.[0-7] mr,
...
  }

i change this ones, this way:

    /usr/local/lib/python3.[0-8]/dist-packages/ r,
    /usr/bin/python3.[0-8] mr,

i look /etc/apparmor.d/abstractions/python and see that python versions are already appreciated up to 3.9.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 77.0.1+build1-0ubuntu0.20.04.1

---------------
firefox (77.0.1+build1-0ubuntu0.20.04.1) focal; urgency=medium

  * New upstream stable release (77.0.1+build1)

  * Minor fixes to the script that creates the source tarball for regressions
    that were introduced by the port to Python 3
    - debian/build/create-tarball.py

 -- Olivier Tilloy <email address hidden> Wed, 03 Jun 2020 17:17:48 +0200

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 77.0.1+build1-0ubuntu0.19.10.1

---------------
firefox (77.0.1+build1-0ubuntu0.19.10.1) eoan; urgency=medium

  * New upstream stable release (77.0.1+build1)

  * Minor fixes to the script that creates the source tarball for regressions
    that were introduced by the port to Python 3
    - debian/build/create-tarball.py

 -- Olivier Tilloy <email address hidden> Wed, 03 Jun 2020 17:16:09 +0200

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package firefox - 77.0.1+build1-0ubuntu0.18.04.1

---------------
firefox (77.0.1+build1-0ubuntu0.18.04.1) bionic; urgency=medium

  * New upstream stable release (77.0.1+build1)

  * Minor fixes to the script that creates the source tarball for regressions
    that were introduced by the port to Python 3
    - debian/build/create-tarball.py

 -- Olivier Tilloy <email address hidden> Wed, 03 Jun 2020 17:08:48 +0200

Changed in firefox (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
dinar qurbanov (qdinar) wrote :

messages, while starting firefox, after updating ubuntu to 20.10:

Jan 11 23:26:48 dinar-comp kernel: [ 181.634648] audit: type=1400 audit(1610396808.475:44): apparmor="DENIED" operation="open" profile="firefox" name="/proc/2003/cgroup" pid=2003 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Jan 11 23:26:48 dinar-comp kernel: [ 181.989310] audit: type=1400 audit(1610396808.831:45): apparmor="DENIED" operation="connect" profile="firefox" name="/tmp/.X11-unix/X0" pid=2207 comm="MainThread" requested_mask="w" denied_mask="w" fsuid=1000 ouid=0

i added these rules:
@{PROC}/[0-9]*/cgroup r,
/tmp/.X11-unix/X0 w,

then, after enabling them and ff restart:

Jan 11 23:45:25 dinar-comp kernel: [ 1298.595946] audit: type=1400 audit(1610397925.435:79): apparmor="DENIED" operation="open" profile="firefox" name="/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us" pid=2437 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

i added this rule:
/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us r,

Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
dinar qurbanov (qdinar) wrote :
Download full text (5.4 KiB)

Linux Mint 20.1 Ulyssa
Firefox 89.0

after update, i got ff 89, i have messages like this in syslog, on every start of firefox:

Jun 20 15:24:23 dinar-Lenovo-G580 wpa_supplicant[680]: wlp2s0: CTRL-EVENT-SIGNAL-CHANGE above=0 signal=-80 noise=-95 txrate=43300
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22164.956789] audit: type=1400 audit(1624191921.071:165): apparmor="DENIED" operation="open" profile="firefox" name="/sys/devices/pci0000:00/0000:00:1f.2/resource" pid=15814 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22164.956816] firefox[15814]: segfault at 0 ip 00007ff585b5ad94 sp 00007ffceca77710 error 6 in libxul.so[7ff582318000+5392000]
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22164.956822] Code: 00 e8 28 69 7c fc 50 80 3d f8 0b 4e 04 00 74 02 58 c3 c6 05 ed 0b 4e 04 01 48 8d 05 29 15 fc 02 48 8b 0d 47 36 3c 04 48 89 01 <c7> 04 25 00 00 00 00 8b 01 00 00 e8 f4 68 7c fc 66 2e 0f 1f 84 00
Jun 20 15:25:21 dinar-Lenovo-G580 systemd[1]: Started Process Core Dump (PID 15815/UID 0).
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22164.998424] audit: type=1400 audit(1624191921.111:166): apparmor="DENIED" operation="open" profile="firefox" name="/run/user/1000/ICEauthority" pid=15809 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Jun 20 15:25:21 dinar-Lenovo-G580 systemd-coredump[15816]: Process 15814 (firefox) of user 1000 dumped core.#012#012Stack trace of thread 15814:#012#0 0x00007ff585b5ad94 n/a (libxul.so + 0x4185d94)#012#1 0x00007ff58ca19a27 __run_exit_handlers (libc.so.6 + 0x49a27)#012#2 0x00007ff58ca19be0 __GI_exit (libc.so.6 + 0x49be0)#012#3 0x00007ff5816f6c45 n/a (libpci.so.3 + 0x3c45)#012#4 0x00007ff5816fc308 n/a (libpci.so.3 + 0x9308)#012#5 0x00007ff585b64054 n/a (libxul.so + 0x418f054)#012#6 0x00007ff585b649db n/a (libxul.so + 0x418f9db)#012#7 0x00007ff585b5a13e n/a (libxul.so + 0x418513e)#012#8 0x00007ff585b60ae3 n/a (libxul.so + 0x418bae3)#012#9 0x00007ff585b60ee0 n/a (libxul.so + 0x418bee0)#012#10 0x0000556820bc9113 n/a (firefox + 0xc113)#012#11 0x00007ff58c9f70b3 __libc_start_main (libc.so.6 + 0x270b3)#012#12 0x0000556820bc8b6e _start (firefox + 0xbb6e)
Jun 20 15:25:21 dinar-Lenovo-G580 systemd[1]: systemd-coredump@8-15815-0.service: Succeeded.
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22165.724715] audit: type=1400 audit(1624191921.839:167): apparmor="DENIED" operation="open" profile="firefox" name="/proc/15809/cgroup" pid=15809 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22165.862576] audit: type=1107 audit(1624191921.975:168): pid=657 uid=103 auid=4294967295 ses=4294967295 msg='apparmor="DENIED" operation="dbus_method_call" bus="system" path="/org/freedesktop/RealtimeKit1" interface="org.freedesktop.DBus.Properties" member="Get" mask="send" name="org.freedesktop.RealtimeKit1" pid=15895 label="firefox" peer_pid=978 peer_label="unconfined"
Jun 20 15:25:21 dinar-Lenovo-G580 kernel: [22165.862576] exe="/usr/bin/dbus-daemon" sauid=103 hostname=? addr=? terminal=?'
Jun 20 15:25:22 dinar-Lenovo-G580 kernel: [22166.090862] audit: type=1107 audit(1624191922.207:169): p...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apparmor (Ubuntu):
status: New → Confirmed
Revision history for this message
dinar qurbanov (qdinar) wrote :

for firefox 107.0.1 in linux mint 20.3 based on Ubuntu 20.04, when task manager is opened, this rule is needed:

owner @{PROC}/[0-9]*/task/[0-9]*/comm r,

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.