FS#78961 - [linux] Kernel 6.4 failing to access TPM on Framework Laptop 12th

Attached to Project: Arch Linux
Opened by TrailingEdge (TrailingEdge) - Monday, 03 July 2023, 14:56 GMT
Last edited by Jan Alexander Steffens (heftig) - Wednesday, 19 July 2023, 21:31 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Levente Polyak (anthraxx)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
After updating to linux-6.4.1 several users of Framework Laptop running Intel 12th gen CPUs [reported](https://community.frame.work/t/boot-and-shutdown-hangs-with-arch-linux-kernel-6-4-1-mainline-and-arch/33118) that their machine fails to boot. It seems it is working fine for the model using 11th gen CPUs.

* When using TPM to unlock a LUKS volume it will wait infinitely to start systemd-cryptsetup. When forcing a reboot, it will still wait for this service to stop and print the following message after waiting for some time (see attached cryptsetup_stack.jpg)
* When disabling TPM unlock, systemd-cryptsetup will start successfully and allow to unlock the volume using the passphrase. However, after that the boot will also wait indefinitely for systemd-pcrphase to start. When force rebooting it will still wait for this service to stop (see pcrphase_stack.jpg).

I bisected the issue and it is caused by commit [e644b2f498d297a928efcb7ff6f900c27f8b788e](https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux/+/e644b2f498d297a928efcb7ff6f900c27f8b788e%5E%21/#F0)

Building the kernel after `git checkout v6.4 && git revert e644b2f498d297a928efcb7ff6f900c27f8b788e` results in a kernel which is booting fine for me.


Additional info:
* Tested package versions: linux-6.4.1.arch1-1 & linux-xanmod-6.4.0-1 & linux-xanmod-6.4.0-2 & linux-xanmod-6.4.1-1
* Kernel config attached
* I found [this issue](https://www.reddit.com/r/archlinux/comments/yshlbf/tpm2_pcr_barrier_initialization_blocking_boot/) and the related links. I am not using tpm2-abrmd and it seems it was resolved in systemd some time ago.

Steps to reproduce:
* Install the most recent kernel on a Framework Laptop 12th generation (in my case i5-1240P)
* Try to boot
   kconfig (209 KiB)
This task depends upon

Closed by  Jan Alexander Steffens (heftig)
Wednesday, 19 July 2023, 21:31 GMT
Reason for closing:  Fixed
Additional comments about closing:  linux 6.4.4.arch1-1
Comment by TrailingEdge (TrailingEdge) - Monday, 03 July 2023, 14:58 GMT
Trying to attach images again
Comment by loqs (loqs) - Monday, 03 July 2023, 15:12 GMT
I think you need a quirk to disable interrupt use on that hardware. Please see [1] and report upstream.

[1] https://lore.kernel.org/linux-integrity/20230620-flo-lenovo-l590-tpm-fix-v1-1-16032a8b5a1d%40bezdeka.de/
Comment by TrailingEdge (TrailingEdge) - Monday, 03 July 2023, 19:39 GMT
Thanks for the good hint. This works as well.
Reported: https://bugzilla.kernel.org/show_bug.cgi?id=217631
Comment by Corey Hinshaw (electrickite) - Monday, 10 July 2023, 15:51 GMT
Development of a patch was moved to the kernel dev mailing list here: https://lore.kernel.org/all/c0ee4b7c-9d63-0bb3-c677-2be045deda43%40leemhuis.info/#t
Comment by Christian Hesse (eworm) - Tuesday, 18 July 2023, 20:41 GMT

Loading...