Comment 0 for bug 2018439

Revision history for this message
Daniel Tang (daniel-z-tg) wrote :

Apparmor crashes GPU acceleration

Firefox GPU acceleration started crashing after updating from Ubuntu 22.10 to 23.04.

$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu 23.04
Release: 23.04

$ apt-cache policy firefox
firefox:
  Installed: 113.0+build1-0ubuntu0.23.04.1~mt1
  Candidate: 113.0+build1-0ubuntu0.23.04.1~mt1
  Version table:
     1:1snap1-0ubuntu3 500
        500 https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu lunar/main amd64 Packages
 *** 113.0+build1-0ubuntu0.23.04.1~mt1 999
        500 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu lunar/main amd64 Packages
        100 /var/lib/dpkg/status

$ apt-cache policy libglx-mesa0
libglx-mesa0:
  Installed: 23.0.3~kisak1~k
  Candidate: 23.0.3~kisak1~k
  Version table:
 *** 23.0.3~kisak1~k 500
        500 https://ppa.launchpadcontent.net/kisak/kisak-mesa/ubuntu kinetic/main amd64 Packages
        100 /var/lib/dpkg/status
     23.0.2-1ubuntu1 500
        500 https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu lunar/main amd64 Packages

$ apt-cache policy apparmor
apparmor:
  Installed: 3.0.8-1ubuntu2
  Candidate: 3.0.8-1ubuntu2
  Version table:
 *** 3.0.8-1ubuntu2 500
        500 https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu lunar/main amd64 Packages
        100 /var/lib/dpkg/status

# Expected behavior

Firefox should not crash in WebGL aquarium and continue to work properly like on 22.10. It should successfully use my GPU to make scrolling smooths and save battery when watching videos.

# Actual behavior

1. Startup takes a second or two longer than usual
2. Typing in the address bar is slow
3. Scrolling takes 400% CPU usage
4. Scrolling stutters
5. VAAPI on https://www.w3schools.com/html/html5_video.asp is no longer used as shown in intel_gpu_top
6. Fans start spinning and battery goes down fast
7. glxtest failures had to be manually deleted in about:config
8. Only a few fish in WebGL aquarium (https://webglsamples.org/aquarium/aquarium.html) load before Firefox force-closes with the message: "Mozilla Crash Reporter Firefox had a problem and crashed. Unfortunately, the crash reporter is unable to submit a crash report. Details: The application did not leave a crash dump file. Close"
9. The following lines are relevant in dmesg after clearing it:

[22157.695580] kauditd_printk_skb: 6 callbacks suppressed
[22157.695582] audit: type=1400 audit(1683153440.994:2583): apparmor="DENIED" operation="capable" class="cap" profile="firefox" pid=15898 comm="firefox" capability=21 capname="sys_admin"
[22157.739641] audit: type=1400 audit(1683153441.038:2584): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/devices/pci0000:00/0000:00:02.0/revision" pid=15901 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22157.739647] audit: type=1400 audit(1683153441.038:2585): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/devices/pci0000:00/0000:00:02.0/config" pid=15901 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22157.739719] audit: type=1400 audit(1683153441.038:2586): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/devices/pci0000:00/0000:00:02.0/revision" pid=15901 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22157.739729] audit: type=1400 audit(1683153441.038:2587): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/devices/pci0000:00/0000:00:02.0/config" pid=15901 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22157.769407] audit: type=1400 audit(1683153441.070:2588): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/proc/15898/oom_score_adj" pid=15898 comm="firefox" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
[22157.773042] audit: type=1400 audit(1683153441.074:2589): apparmor="DENIED" operation="file_mmap" class="file" profile="firefox//lsb_release" name="/usr/bin/dash" pid=15934 comm="lsb_release" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22157.974718] audit: type=1400 audit(1683153441.274:2590): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/proc/15898/cgroup" pid=15898 comm="firefox" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000
[22157.996255] audit: type=1400 audit(1683153441.298:2591): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/devices/pci0000:00/0000:00:02.0/revision" pid=15898 comm="Renderer" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22157.996260] audit: type=1400 audit(1683153441.298:2592): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/devices/pci0000:00/0000:00:02.0/config" pid=15898 comm="Renderer" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
[22163.478994] kauditd_printk_skb: 84 callbacks suppressed
[22163.478997] audit: type=1400 audit(1683153446.778:2677): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/25/11491cb402d47ca04c0196ff7c4dc9684f1f97.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22163.597737] audit: type=1400 audit(1683153446.898:2678): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/proc/16052/oom_score_adj" pid=15898 comm="firefox" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
[22163.602664] audit: type=1400 audit(1683153446.902:2679): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/proc/16019/oom_score_adj" pid=15898 comm="firefox" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000
[22163.681703] audit: type=1400 audit(1683153446.982:2680): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/3c/8574ff630bb2056a665c574f9820f176d7913a.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22163.716158] audit: type=1400 audit(1683153447.018:2681): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/24/20b4d21bcd624d71d3ce4f474b5be6b28bbc8e.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22163.772912] audit: type=1400 audit(1683153447.074:2682): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/63/f955ef3504ae1f103040d7c24f2ccb6c2dc324.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22163.821410] audit: type=1400 audit(1683153447.122:2683): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/cc/26d55b3b5c18f145b99c95928da4078d01e433.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22163.934506] audit: type=1400 audit(1683153447.234:2684): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/71/7a666e633ee8a8408541d19257f35460da1921.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22164.011166] audit: type=1400 audit(1683153447.310:2685): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/6f/a3c5a35037023fcb4630ee71df1e17107a0132.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000
[22164.049428] audit: type=1400 audit(1683153447.350:2686): apparmor="DENIED" operation="file_lock" class="file" profile="firefox" name="/home/home/.cache/mesa_shader_cache/cf/d8f7837a74690386158ffe0b8a009a74112c3e.tmp" pid=15898 comm="firefox:disk$0" requested_mask="k" denied_mask="k" fsuid=1000 ouid=1000

`apport-bug firefox` is not working: "Apport The problem cannot be reported: This problem report is damaged and cannot be processed. PermissionError(13, 'Permission denied')"
`LIBGL_ALWAYS_INDIRECT=1 firefox` stops the crashing but WebGL aquarium runs at 12 FPS instead of 60 FPS.

# Workaround

`sudo aa-teardown` fixes the problem until the next reboot. It's regrettable that this weakens security, but at least I won't get nauseous from stuttering scrolling.