A kernel panic, caused by apparmor?

inxi -Fxza
System:    Kernel: 5.11.16-2-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.11-x86_64 root=UUID=c28c9ba1-1ab9-48ed-a6c3-a5cf6794acea ro apparmor=1 
           security=apparmor udev.log_priority=3 sysrq_always_enabled=1 
           Desktop: KDE Plasma 5.21.4 tk: Qt 5.15.2 wm: kwin_x11 vt: 2 dm: SDDM Distro: Manjaro Linux base: Arch Linux 
Machine:   Type: Desktop Mobo: Micro-Star model: B450M MORTAR MAX (MS-7B89) v: 1.0 serial: <filter> 
           UEFI: American Megatrends LLC. v: 2.C0 date: 02/01/2021 
CPU:       Info: 8-Core model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ family: 17 (23) model-id: 8 stepping: 2 
           microcode: 800820D cache: L2: 4 MiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 118445 
           Speed: 1891 MHz min/max: 2200/3700 MHz boost: enabled Core speeds (MHz): 1: 1891 2: 1930 3: 1719 4: 2006 5: 4340 
           6: 1923 7: 1926 8: 2163 9: 1719 10: 1717 11: 2859 12: 1724 13: 1771 14: 2144 15: 2348 16: 1851 
           Vulnerabilities: Type: itlb_multihit status: Not affected 
           Type: l1tf status: Not affected 
           Type: mds status: Not affected 
           Type: meltdown status: Not affected 
           Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl and seccomp 
           Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization 
           Type: spectre_v2 mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling 
           Type: srbds status: Not affected 
           Type: tsx_async_abort status: Not affected 
Graphics:  Device-1: NVIDIA GP102 [GeForce GTX 1080 Ti] vendor: ASUSTeK driver: nvidia v: 460.73.01 
           alternate: nouveau,nvidia_drm bus-ID: 26:00.0 chip-ID: 10de:1b06 class-ID: 0300 
           Display: x11 server: X.Org 1.20.11 compositor: kwin_x11 driver: loaded: nvidia display-ID: :0 screens: 1 
           Screen-1: 0 s-res: 2560x1440 s-dpi: 108 s-size: 602x342mm (23.7x13.5") s-diag: 692mm (27.3") 
           Monitor-1: DP-0 res: 2560x1440 hz: 144 dpi: 109 size: 597x336mm (23.5x13.2") diag: 685mm (27") 
           OpenGL: renderer: GeForce GTX 1080 Ti/PCIe/SSE2 v: 4.6.0 NVIDIA 460.73.01 direct render: Yes 
Audio:     Device-1: NVIDIA GP102 HDMI Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus-ID: 26:00.1 
           chip-ID: 10de:10ef class-ID: 0403 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel 
           bus-ID: 28:00.3 chip-ID: 1022:1457 class-ID: 0403 
           Device-3: GYROCOM C&C UAC1 DAC type: USB driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-10:3 chip-ID: 1852:5110 
           class-ID: 0102 
           Sound Server-1: ALSA v: k5.11.16-2-MANJARO running: yes 
           Sound Server-2: JACK v: 0.125.0 running: no 
           Sound Server-3: PulseAudio v: 14.2 running: yes 
           Sound Server-4: PipeWire v: 0.3.26 running: yes 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Micro-Star MSI driver: r8169 v: kernel 
           port: e000 bus-ID: 22:00.0 chip-ID: 10ec:8168 class-ID: 0200 
           IF: enp34s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
RAID:      Supported mdraid levels: raid0 
           Device-1: md0 maj-min: 9:0 type: mdraid level: raid-0 status: active size: 744.74 GiB 
           Info: report: N/A blocks: 780914688 chunk-size: 512k super-blocks: 1.2 
           Components: Online: 
           0: sdb maj-min: 8:16 size: 186.31 GiB 
           1: sde maj-min: 8:64 size: 186.31 GiB 
           2: sdc maj-min: 8:32 size: 186.31 GiB 
           3: sdd maj-min: 8:48 size: 186.31 GiB 
Drives:    Local Storage: total: raw: 1.18 TiB usable: 1.18 TiB used: 477.53 GiB (39.4%) 
           SMART Message: Unable to run smartctl. Root privileges required. 
           ID-1: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB block-size: physical: 512 B 
           logical: 512 B speed: 6.0 Gb/s rotation: SSD serial: <filter> rev: 4B6Q scheme: GPT 
           ID-2: /dev/sdb maj-min: 8:16 model: SSD 910 200GB size: 186.31 GiB block-size: physical: 4096 B logical: 512 B 
           rotation: SSD serial: N/A rev: a424 
           ID-3: /dev/sdc maj-min: 8:32 model: SSD 910 200GB size: 186.31 GiB block-size: physical: 4096 B logical: 512 B 
           rotation: SSD serial: N/A rev: a424 
           ID-4: /dev/sdd maj-min: 8:48 model: SSD 910 200GB size: 186.31 GiB block-size: physical: 4096 B logical: 512 B 
           rotation: SSD serial: N/A rev: a424 
           ID-5: /dev/sde maj-min: 8:64 model: SSD 910 200GB size: 186.31 GiB block-size: physical: 4096 B logical: 512 B 
           rotation: SSD serial: N/A rev: a424 
Partition: ID-1: / raw-size: 465.26 GiB size: 456.96 GiB (98.22%) used: 195.32 GiB (42.7%) fs: ext4 dev: /dev/sda2 
           maj-min: 8:2 
           ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%) used: 296 KiB (0.1%) fs: vfat dev: /dev/sda1 maj-min: 8:1 
Swap:      Alert: No swap data was found. 
Sensors:   System Temperatures: cpu: 43.2 C mobo: 43.0 C gpu: nvidia temp: 43 C 
           Fan Speeds (RPM): fan-1: 0 fan-2: 1234 fan-3: 1002 fan-4: 642 fan-5: 882 gpu: nvidia fan: 33% 
Info:      Processes: 329 Uptime: 1d 8h 29m wakeups: 0 Memory: 31.35 GiB used: 4.58 GiB (14.6%) Init: systemd v: 247 
           tool: systemctl Compilers: gcc: 10.2.0 Packages: pacman: 1375 lib: 427 Shell: Zsh v: 5.8 running-in: yakuake 
           inxi: 3.3.04

I was checking my journals for no reason, after having over 24 hours uptime.
I noticed that I’ve had a kernel panic or something similar when I was away from the computer, with the displayed turned off.

journalctl snippet
huhti 28 10:37:15 kernel: BUG: kernel NULL pointer dereference, address: 0000000000000078
huhti 28 10:37:15 kernel: #PF: supervisor read access in kernel mode
huhti 28 10:37:15 kernel: #PF: error_code(0x0000) - not-present page
huhti 28 10:37:15 kernel: PGD 0 P4D 0 
huhti 28 10:37:15 kernel: Oops: 0000 [#1] PREEMPT SMP NOPTI
huhti 28 10:37:15 kernel: CPU: 12 PID: 289312 Comm: watch Tainted: P           OE     5.11.16-2-MANJARO #1
huhti 28 10:37:15 kernel: Hardware name: Micro-Star International Co., Ltd. MS-7B89/B450M MORTAR MAX (MS-7B89), BIOS 2.C0 02/01/2021
huhti 28 10:37:15 kernel: RIP: 0010:apparmor_file_permission+0x3f/0x160
huhti 28 10:37:15 kernel: Code: 00 41 56 41 55 41 89 f5 41 54 49 89 fc 55 53 65 48 8b 04 25 c0 7b 01 00 48 83 ec 08 48 8b 90 40 07 00 00 48 63 05 a1 c6 00 01 <48> 8b 52 78 48 8b 2c 02 f6 45 41 08 75 63 48 85 ed 0f 95 c3 44 >
huhti 28 10:37:15 kernel: RSP: 0018:ffffa18345a4be78 EFLAGS: 00010296
huhti 28 10:37:15 kernel: RAX: 0000000000000000 RBX: ffffffffada41220 RCX: 0000000000002000
huhti 28 10:37:15 kernel: RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8ed3f7e11700
huhti 28 10:37:15 kernel: RBP: ffff8ed3f7e11700 R08: 0000000000000003 R09: 0000000000000001
huhti 28 10:37:15 kernel: R10: 0000000000000001 R11: 0000000000000000 R12: ffff8ed3f7e11700
huhti 28 10:37:15 kernel: R13: 0000000000000004 R14: 0000555f9049caa2 R15: ffffa18345a4bf10
huhti 28 10:37:15 kernel: FS:  00007f3647044740(0000) GS:ffff8ed91ed00000(0000) knlGS:0000000000000000
huhti 28 10:37:15 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
huhti 28 10:37:15 kernel: CR2: 0000000000000078 CR3: 0000000156c22000 CR4: 00000000003506e0
huhti 28 10:37:15 kernel: Call Trace:
huhti 28 10:37:15 kernel:  security_file_permission+0x2c/0x150
huhti 28 10:37:15 kernel:  vfs_read+0x74/0x1a0
huhti 28 10:37:15 kernel:  ksys_read+0x67/0xe0
huhti 28 10:37:15 kernel:  do_syscall_64+0x33/0x40
huhti 28 10:37:15 kernel:  entry_SYSCALL_64_after_hwframe+0x44/0xa9
huhti 28 10:37:15 kernel: RIP: 0033:0x7f364727c052
huhti 28 10:37:15 kernel: Code: c0 e9 b2 fe ff ff 50 48 8d 3d ca 2f 0a 00 e8 55 e8 01 00 0f 1f 44 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 0f 05 <48> 3d 00 f0 ff ff 77 56 c3 0f 1f 44 00 00 48 83 ec 28 48 89 54 >
huhti 28 10:37:15 kernel: RSP: 002b:00007ffd2c2d5e18 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
huhti 28 10:37:15 kernel: RAX: ffffffffffffffda RBX: 0000555f9049b370 RCX: 00007f364727c052
huhti 28 10:37:15 kernel: RDX: 0000000000002000 RSI: 0000555f9049caa2 RDI: 0000000000000003
huhti 28 10:37:15 kernel: RBP: 00007f364734f300 R08: 0000000000000003 R09: 0000555f9049ea9e
huhti 28 10:37:15 kernel: R10: 00007f3647364120 R11: 0000000000000246 R12: 0000000000002000
huhti 28 10:37:15 kernel: R13: 0000555f9049caa2 R14: 0000000000000d68 R15: 00007f364734e700
huhti 28 10:37:15 kernel: Modules linked in: udp_diag tcp_diag inet_diag snd_seq_dummy snd_seq nvidia_uvm(POE) snd_usb_audio snd_usbmidi_lib snd_rawmidi snd_seq_device joydev mc mousedev rfkill snd_hda_codec_realtek snd_hda>
huhti 28 10:37:15 kernel:  crypto_user fuse ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 raid0 md_mod hid_steam usbhid crc32c_intel mpt3sas raid_class scsi_transport_sas xhci_pci
huhti 28 10:37:15 kernel: CR2: 0000000000000078
huhti 28 10:37:15 kernel: ---[ end trace 5056834a076d358c ]---
huhti 28 10:37:15 kernel: RIP: 0010:apparmor_file_permission+0x3f/0x160
huhti 28 10:37:15 kernel: Code: 00 41 56 41 55 41 89 f5 41 54 49 89 fc 55 53 65 48 8b 04 25 c0 7b 01 00 48 83 ec 08 48 8b 90 40 07 00 00 48 63 05 a1 c6 00 01 <48> 8b 52 78 48 8b 2c 02 f6 45 41 08 75 63 48 85 ed 0f 95 c3 44 >
huhti 28 10:37:15 kernel: RSP: 0018:ffffa18345a4be78 EFLAGS: 00010296
huhti 28 10:37:15 kernel: RAX: 0000000000000000 RBX: ffffffffada41220 RCX: 0000000000002000
huhti 28 10:37:15 kernel: RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8ed3f7e11700
huhti 28 10:37:15 kernel: RBP: ffff8ed3f7e11700 R08: 0000000000000003 R09: 0000000000000001
huhti 28 10:37:15 kernel: R10: 0000000000000001 R11: 0000000000000000 R12: ffff8ed3f7e11700
huhti 28 10:37:15 kernel: R13: 0000000000000004 R14: 0000555f9049caa2 R15: ffffa18345a4bf10
huhti 28 10:37:15 kernel: FS:  00007f3647044740(0000) GS:ffff8ed91ed00000(0000) knlGS:0000000000000000
huhti 28 10:37:15 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
huhti 28 10:37:15 kernel: CR2: 0000000000000078 CR3: 0000000156c22000 CR4: 00000000003506e0

When I returned to my PC hours later, everything was as I left it, and everything’s been working since. It’s been over 18 hours now from those errors, and I’m writing this message from the same session. I wouldn’t have known something had gone wrong earlier if I didn’t decide to check the journal just for a random check.

I’ve done some searches with those errors, but I’m not quite sure if this is just some bug in the kernel, or if this requires action from me… :thinking:

That’s not a kernel panic. If it was, then it would explicitly say so, and then your machine would be hung at a tty screen with the stack trace and the kernel panic on the screen. If the kernel panics, then the operating system stops running.

By the way, if your machine has been up for 40 hours now, then you haven’t updated yet. There was a major update earlier today. :arrow_down:

I thought that would happen as well… Pretty much all my search results were discussing a kernel panic, so that confused me a bit. Hence I called it “a kernel panic or something similar” :grin:

Edit:

I’m in the Testing branch, with the latest updates installed

Edit: Shoot, I just realised I didn’t switch to kernel 5.12 yet :man_facepalming: