Closed tqre closed 4 years ago
@tqre: Which kernel version are you using? (NVM looks like you are using 5.7.11-hardened). I'm currently on 5.7.10 and I'm not having the issue. I also didn't have the issue on the lts kernel.
I've upgraded to 5.7.11 non hardened and I haven't had any issues so far. Unfortunately, I haven't been able to make 5.7.11-hardened boot.
Sorry for the lack of details, I didn't go into details as this issue should go away soon(tm) anyway.
The issue occurs when a non-root user issues a reboot or shutdown command via sudo, or a non-root user is logged when a shutdown command is issued. I'm also using more recent version of pam-selinux and pambase on my own fork/develop branch: https://github.com/tqre/selinux/tree/develop
lts-kernel should not have this issue as it is a regression issue, can't say for sure though.
Just a side note: I managed to put together a minimal base-selinux package, which can be bootstrapped from ArchISO with pacstrap instead of base package. For now it needs a custom local pacman repo though. I'll try to publish a binary repo once I get some more testing done and the actual public space in a closeby Arch mirror to host it.
Out of curiosity have you tried the default kernel package?
For me this happens with the default kernel too.
For me, it happens with the default kernel, and result with an "OOPS" that kills the task but does not panic. I guess that sysctl kernel.panic_on_oops
is the setting that triggers a panic when this issue occurs.
More precisely, here is my dmesg
with linux
5.7.10-arch1-1
on the Vagrant virtual machine which is in _vagrant/
, which looks very similar to the bug report https://bugs.archlinux.org/task/67400:
[ 84.437406] BUG: kernel NULL pointer dereference, address: 0000000000000060
[ 84.437431] #PF: supervisor read access in kernel mode
[ 84.437459] #PF: error_code(0x0000) - not-present page
[ 84.437473] PGD 0 P4D 0
[ 84.437483] Oops: 0000 [#1] PREEMPT SMP PTI
[ 84.437494] CPU: 0 PID: 3470 Comm: systemd-user-ru Not tainted 5.7.10-arch1-1 #1
[ 84.437508] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20200516_175120-felixonmars2 04/01/2014
[ 84.437534] RIP: 0010:d_path+0x47/0x170
[ 84.437544] Code: 04 25 28 00 00 00 48 89 44 24 20 31 c0 48 63 c2 48 c7 44 24 10 00 00 00 00 48 c7 44 24 18 00 00 00 00 48 01 f0 48 89 44 24 08 <48> 8b 47 60 48 85 c0 74 3d 48 8b 40 48 48 85 c0 74 34 41 89 d0 48
[ 84.437578] RSP: 0018:ffffb27240317e20 EFLAGS: 00010282
[ 84.437589] RAX: ffff9ae3ee90100b RBX: ffff9ae3f55de860 RCX: 0000000000000000
[ 84.437604] RDX: 000000000000100b RSI: ffff9ae3ee900000 RDI: 0000000000000000
[ 84.437618] RBP: ffffb27240317e50 R08: ffff9ae3d29c1ec0 R09: ffff9ae3ee900000
[ 84.437633] R10: ffffffffffffffff R11: ffff9ae3d29c1831 R12: ffff9ae3f55deab0
[ 84.437648] R13: ffff9ae3fb815ca8 R14: ffff9ae3f55de800 R15: 0000000000000000
[ 84.437663] FS: 00007fe6f6338140(0000) GS:ffff9ae3fdc00000(0000) knlGS:0000000000000000
[ 84.437680] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 84.437692] CR2: 0000000000000060 CR3: 0000000073502000 CR4: 00000000000006f0
[ 84.437710] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 84.437723] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 84.437736] Call Trace:
[ 84.437761] audit_log_d_path+0x75/0xd0
[ 84.437776] audit_log_exit+0x649/0xd30
[ 84.437788] __audit_syscall_exit+0x22c/0x2b0
[ 84.437800] syscall_slow_exit_work+0x134/0x160
[ 84.437812] do_syscall_64+0x86/0x90
[ 84.437823] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 84.437842] RIP: 0033:0x7fe6f73407db
[ 84.437855] Code: 73 01 c3 48 8b 0d b5 d6 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 07 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 85 d6 0c 00 f7 d8 64 89 01 48
[ 84.437889] RSP: 002b:00007ffe78956998 EFLAGS: 00000246 ORIG_RAX: 0000000000000107
[ 84.437907] RAX: 0000000000000000 RBX: 00007fe6f63380c0 RCX: 00007fe6f73407db
[ 84.437922] RDX: 0000000000000000 RSI: 0000565314567c13 RDI: 0000000000000004
[ 84.437935] RBP: 0000000000000004 R08: 0000565314567c00 R09: 00007fe6f740ea40
[ 84.437948] R10: 0000000000000004 R11: 0000000000000246 R12: 0000565314567ba0
[ 84.437968] R13: 0000000000000000 R14: 0000565314567c00 R15: 0000565314567c13
[ 84.437984] Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c br_netfilter bridge stp llc overlay cirrus drm_kms_helper joydev cec mousedev rc_core syscopyarea sysfillrect sysimgblt fb_sys_fops i2c_piix4 psmouse intel_agp input_leds intel_gtt evdev mac_hid pcspkr qemu_fw_cfg drm agpgart ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 virtio_net virtio_blk net_failover virtio_balloon failover ata_generic pata_acpi serio_raw atkbd libps2 virtio_pci ata_piix uhci_hcd ehci_pci ehci_hcd floppy i8042 serio
[ 84.438124] CR2: 0000000000000060
[ 84.438134] ---[ end trace 7b036651f715e4c9 ]---
[ 84.439294] RIP: 0010:d_path+0x47/0x170
[ 84.440393] Code: 04 25 28 00 00 00 48 89 44 24 20 31 c0 48 63 c2 48 c7 44 24 10 00 00 00 00 48 c7 44 24 18 00 00 00 00 48 01 f0 48 89 44 24 08 <48> 8b 47 60 48 85 c0 74 3d 48 8b 40 48 48 85 c0 74 34 41 89 d0 48
[ 84.441537] RSP: 0018:ffffb27240317e20 EFLAGS: 00010282
[ 84.442088] RAX: ffff9ae3ee90100b RBX: ffff9ae3f55de860 RCX: 0000000000000000
[ 84.442629] RDX: 000000000000100b RSI: ffff9ae3ee900000 RDI: 0000000000000000
[ 84.443174] RBP: ffffb27240317e50 R08: ffff9ae3d29c1ec0 R09: ffff9ae3ee900000
[ 84.446616] R10: ffffffffffffffff R11: ffff9ae3d29c1831 R12: ffff9ae3f55deab0
[ 84.447707] R13: ffff9ae3fb815ca8 R14: ffff9ae3f55de800 R15: 0000000000000000
[ 84.448781] FS: 00007fe6f6338140(0000) GS:ffff9ae3fdc00000(0000) knlGS:0000000000000000
[ 84.449358] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 84.453240] CR2: 00005623f5b3c6e8 CR3: 0000000073502000 CR4: 00000000000006f0
[ 84.454446] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 84.454971] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 84.456088] BUG: kernel NULL pointer dereference, address: 0000000000000060
[ 84.456637] #PF: supervisor read access in kernel mode
[ 84.457184] #PF: error_code(0x0000) - not-present page
[ 84.457719] PGD 0 P4D 0
[ 84.458247] Oops: 0000 [#2] PREEMPT SMP PTI
[ 84.458756] CPU: 0 PID: 3470 Comm: systemd-user-ru Tainted: G D 5.7.10-arch1-1 #1
[ 84.459273] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20200516_175120-felixonmars2 04/01/2014
[ 84.459795] RIP: 0010:d_path+0x47/0x170
[ 84.460298] Code: 04 25 28 00 00 00 48 89 44 24 20 31 c0 48 63 c2 48 c7 44 24 10 00 00 00 00 48 c7 44 24 18 00 00 00 00 48 01 f0 48 89 44 24 08 <48> 8b 47 60 48 85 c0 74 3d 48 8b 40 48 48 85 c0 74 34 41 89 d0 48
[ 84.461418] RSP: 0000:ffffb27240317dd8 EFLAGS: 00010282
[ 84.461933] RAX: ffff9ae3ee90300b RBX: ffff9ae3f55de860 RCX: 0000000000000000
[ 84.462466] RDX: 000000000000100b RSI: ffff9ae3ee902000 RDI: 0000000000000000
[ 84.463017] RBP: ffffb27240317e08 R08: ffff9ae3d29c0ec0 R09: ffff9ae3ee902000
[ 84.463567] R10: ffffffffffffffff R11: ffff9ae3d29c0831 R12: ffff9ae3f55deab0
[ 84.464146] R13: ffff9ae3fb815270 R14: ffff9ae3f55de800 R15: 0000000000000000
[ 84.464677] FS: 00007fe6f6338140(0000) GS:ffff9ae3fdc00000(0000) knlGS:0000000000000000
[ 84.465273] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 84.465872] CR2: 0000000000000060 CR3: 0000000073502000 CR4: 00000000000006f0
[ 84.466435] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 84.466986] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 84.467572] Call Trace:
[ 84.468125] audit_log_d_path+0x75/0xd0
[ 84.468683] audit_log_exit+0x649/0xd30
[ 84.469336] __audit_free+0x242/0x270
[ 84.469882] do_exit+0x8b2/0xab0
[ 84.470410] rewind_stack_do_exit+0x17/0x20
[ 84.470959] RIP: 0033:0x7fe6f73407db
[ 84.471467] Code: 73 01 c3 48 8b 0d b5 d6 0c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 07 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 85 d6 0c 00 f7 d8 64 89 01 48
[ 84.472482] RSP: 002b:00007ffe78956998 EFLAGS: 00000246 ORIG_RAX: 0000000000000107
[ 84.472989] RAX: 0000000000000000 RBX: 00007fe6f63380c0 RCX: 00007fe6f73407db
[ 84.473496] RDX: 0000000000000000 RSI: 0000565314567c13 RDI: 0000000000000004
[ 84.474004] RBP: 0000000000000004 R08: 0000565314567c00 R09: 00007fe6f740ea40
[ 84.474545] R10: 0000000000000004 R11: 0000000000000246 R12: 0000565314567ba0
[ 84.475055] R13: 0000000000000000 R14: 0000565314567c00 R15: 0000565314567c13
[ 84.475529] Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xfrm_user xfrm_algo xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c br_netfilter bridge stp llc overlay cirrus drm_kms_helper joydev cec mousedev rc_core syscopyarea sysfillrect sysimgblt fb_sys_fops i2c_piix4 psmouse intel_agp input_leds intel_gtt evdev mac_hid pcspkr qemu_fw_cfg drm agpgart ip_tables x_tables ext4 crc32c_generic crc16 mbcache jbd2 virtio_net virtio_blk net_failover virtio_balloon failover ata_generic pata_acpi serio_raw atkbd libps2 virtio_pci ata_piix uhci_hcd ehci_pci ehci_hcd floppy i8042 serio
[ 84.478667] CR2: 0000000000000060
[ 84.506589] ---[ end trace 7b036651f715e4ca ]---
[ 84.507733] RIP: 0010:d_path+0x47/0x170
[ 84.508834] Code: 04 25 28 00 00 00 48 89 44 24 20 31 c0 48 63 c2 48 c7 44 24 10 00 00 00 00 48 c7 44 24 18 00 00 00 00 48 01 f0 48 89 44 24 08 <48> 8b 47 60 48 85 c0 74 3d 48 8b 40 48 48 85 c0 74 34 41 89 d0 48
[ 84.510503] RSP: 0018:ffffb27240317e20 EFLAGS: 00010282
[ 84.511613] RAX: ffff9ae3ee90100b RBX: ffff9ae3f55de860 RCX: 0000000000000000
[ 84.512173] RDX: 000000000000100b RSI: ffff9ae3ee900000 RDI: 0000000000000000
[ 84.512772] RBP: ffffb27240317e50 R08: ffff9ae3d29c1ec0 R09: ffff9ae3ee900000
[ 84.514319] R10: ffffffffffffffff R11: ffff9ae3d29c1831 R12: ffff9ae3f55deab0
[ 84.515936] R13: ffff9ae3fb815ca8 R14: ffff9ae3f55de800 R15: 0000000000000000
[ 84.516539] FS: 00007fe6f6338140(0000) GS:ffff9ae3fdc00000(0000) knlGS:0000000000000000
[ 84.517909] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 84.518477] CR2: 00007fe6258be024 CR3: 0000000073502000 CR4: 00000000000006f0
[ 84.519033] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 84.519564] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 84.524527] Fixing recursive fault but reboot is needed!
Along with kernel 5.8.1-arch1-1 this issue got fixed. My test machines reboot and shut down fine now.
It looks like we are affected by this: https://bugs.archlinux.org/task/67400 Patch is already on it's way in the kernel upstream: https://www.redhat.com/archives/linux-audit/2020-July/msg00144.html
Here are logs from my test VM: