FS#57706 - [linux-hardened] >= 4.14.17 kernel panic when booting

Attached to Project: Arch Linux
Opened by Reinardo Escobar (wincraft71) - Saturday, 03 March 2018, 07:05 GMT
Last edited by Levente Polyak (anthraxx) - Friday, 14 September 2018, 11:36 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Kernel panic immediately when booting into initramfs. I'm using full disk encryption with a custom encrypt hook. Linux kernel boots fine.

(Transcribed from a picture without timestamps, so overlook any typos)

kernel BUG at ./include/linux/scatterlist.h:147!
invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
Modules linked in: uas usb_storage rtsx_pci_sdmc mmc_core serio_raw atkbd libps2 crct10dif_pclmul crc32_pclmul crc32_intel ghash_clmulni_intel pcbc ahci aesni_intel aes_x864_64 crypto_simd libahci glue_helper cryptd xhci_pci libata ehci_pci xhci_hcd ehci_hcd scsi_mod usbcore ccp usb_common rtsx_pci rng_core i8042 serio loop
CPU: 0 PID: 200 Comm: scsi_eh_1 Not tainted 4.15.4-1-hardened #1
Hardware Name: *omitted*
RIP: 0010:sig_init_one+0x85/0xa0
RSP: 0018:ffffa4bcc09fbad8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffffa4bcc09fbb78 RCX: 0000000000000028
RDX: 00000a11409fbb78 RSI: 000000000000000a RDI: ffffa4bd409fbb78
RBP: 0000000000000010 R08: ffffa4bcc09fbb00 R09: ffffa4bcc09fbb00
R10: ffffa4bcc09fba70 R11: ffffffffc012bbb7 R12: ffffa4bcc09fbb00
R13: ffffffffc012a878 R14: ffffffffc012a878 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8aacbec00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00006c4ecc73fe97 CR3: 0000000136644000 CR4: 00000000000406f0

Call Trace:
ata_exec_internal+0x44/0x90 [libata]
zpodd_init+0xeb/0x1c0 [libata]
ata_dev_configure+0x10f9/0x1630 [libata]
ata_eh_recover+0x997/0x1370 [libata]
? ata_phys_link_offline+0x60/0x60 [libata]
? ahci_do_softreset+0x270/0x270 [libahci]
? ahci_do_hardreset+0x140/0x140 [libahci]
? ahci_pmp_attach+0x60+0x60 [libahci]
? ahci_do_softreset+0x270/0x270 [libahci]
sata_pmp_error_handler+0x541/0xa40 [libata]
?__clear_rsb+0x15/0x3d
? ahci_do_hardreset+0x140/0x140 [libahci]
? ahci_do_softreset+0x270/0x270 [libahci]
? ahci_pmp_attach+0x60+0x60 [libahci]
? ata_phys_link_offline+0x60/0x60 [libata]
? _raw_spin_lock_irqsave+0x25/0x50
? lock_timer_base+0x67/0x80
ahci_error_handler+0x18/0x60 [libahci]
ata_scsi_port_error_handler+0x292/0x760 [libata]
? scsi_eh_get_sense+0x1e0/0x1e0 [scsi_mod]
ata_scsi_error+0x91/0xc0 [libata]
? scsi_try_target_reset+0x90/0x90 [scsi_mod]
scsi_error_handler+0xd1/0x5b0 [scsi_mod]
? scsi_eh_get_sense+0x1e0/0x1e0 [scsi_mod]
kthread+0x113/0x130
? kthread_create_on_node+0x70/0x70
ret_from_fork+0x22/0x40
Code: 2e 49 8b 54 24 08 f6 c2 01 75 26 83 e2 03 81 e3 ff 0f 00 00 41 89 6c 24 14 48 09 d0 41 89 5c 24 10 49 89 44 24 08 5b 5d 41 5c c3 <0f> 0b 0f 0b 0f 0b 0f 0b 48 8b 15 3c 61 c8 00 eb a4 66 2e 0f 1f
RIP: sg_init_one+0x85/0xa0 RSP: ffffa4bcc09fbad8
---[end trace 44ceaec880f04c7c ]---
Kernel panic - not syncing: Fatal exception
Kernel offset: 0x1e000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff
---[end Kernel panic - not syncing: Fatal exception
This task depends upon

Closed by  Levente Polyak (anthraxx)
Friday, 14 September 2018, 11:36 GMT
Reason for closing:  No response
Comment by Reinardo Escobar (wincraft71) - Saturday, 03 March 2018, 21:13 GMT
The title should say "> 4.14.17". Every update after 4.14.17 has the same panic so far, but 4.14.17 will boot.

Also on the first "RIP:", "sig" should be "sg".
Comment by loqs (loqs) - Saturday, 03 March 2018, 22:31 GMT
So every release of 4.15 for linux-hardened has been affected?
Comment by Reinardo Escobar (wincraft71) - Saturday, 03 March 2018, 22:44 GMT
@loqs Yes that is correct, I've tried booting every update and always get the same message above. The line 147 in scatterlist.h on the linux-hardened github page is "BUG_ON(!virt_addr_valid(buf));"
Comment by loqs (loqs) - Saturday, 03 March 2018, 22:54 GMT
https://git.archlinux.org/svntogit/packages.git/tree/trunk/config?h=packages/linux&id=2e4e2c852826fa35b271928cc9416561da2e0f94#n8980 linux 4.15.16-1 does not have CONFIG_DEBUG_SG enabled
https://git.archlinux.org/svntogit/community.git/tree/trunk/config.x86_64?h=packages/linux-hardened&id=7d0580a17538d8219a00050b092ba29183017ec7#n8978 linux-hardened 4.15.17-a1 does have CONFIG_DEBUG_SG enabled
If you rebuild the linux package with CONFIG_DEBUG_SG enabled or the complete config from linux-hardened copied across does the issue occur on linux with that config?
Comment by Reinardo Escobar (wincraft71) - Saturday, 03 March 2018, 23:04 GMT
@loqs
Thanks for the tip, I'll rebuild linux with CONFIG_DEBUG_SG enabled starting now and try it again, then let you know what happens.
Comment by Reinardo Escobar (wincraft71) - Sunday, 04 March 2018, 06:30 GMT
@loqs
I can confirm that setting CONFIG_DEBUG_SG=y in the config file for the linux package before building it causes the same kernel panic.

What triggers "BUG_ON(!virt_addr_valid(buf));" in scatterlist.h? Somehow what's passed in "buf" is not valid.
Comment by loqs (loqs) - Sunday, 04 March 2018, 11:55 GMT
https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/linux-hardened&id=fb2609ecaf19e4aaad585d5f329565a48555e3ac
linux-hardened enabled CONFIG_DEBUG_SG with 4.15.1-a1 so it is unknown if it is a new issue with 4.15
or was present in older kernels but never detected because the option was not enabled. You could try 4.14 or 4.16-rc3 with CONFIG_DEBUG_SG or
https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html
$ perl scripts/get_maintainer.pl -f drivers/ata/libata-core.c
Tejun Heo <tj@kernel.org> (maintainer:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers))
linux-ide@vger.kernel.org (open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers))
linux-kernel@vger.kernel.org (open list)
report the issue upstream either linux-ide@vger.kernel.org or the kernel bugzilla.
Edit:
As linux-hardened is not supported by kernel.org please use the linux package / git trees from kernel.org and the outputs they generate when working with upstream.
Comment by Levente Polyak (anthraxx) - Wednesday, 04 July 2018, 22:35 GMT
so this is not a linux-hardened issue per se, what is the status did you report your bug upstream?

Loading...