Re: TPM V2: kernel panic on linux reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 27, 2021 at 02:51:56PM +0000, florian.manoel@xxxxxxxxxxx wrote:
> Hi,
> 
> thanks for your support,
> an update on the kernel panic I am experiencing while trying to set up a TPM V2 on an ARM64 NXP LS1043a custom board :
> We updated the kernel from 4.19.144 to 4.19.165, no changes, the panic is still occurring.
> 
> I started to debug, and identify what I believe is the point where this kernel panic is triggered:
> '/drivers/char/tpm/tpm-interface.c'
> 
> "
> 	if (chip->ops->clk_enable != NULL)
> 		chip->ops->clk_enable(chip, true);
> "

BTW, that is quite stupid code from us. In all cases a direct call to
tpm_tis_clkrun_enable() would make a lot more sense. Anyway, this does
not explain the bug. This just hurts my eyes, that's all..

Anyway we, can disclose that function given the IS_ENABLED() check early
on:

static void tpm_tis_clkrun_enable(struct tpm_chip *chip, bool value)
{
	struct tpm_tis_data *data = dev_get_drvdata(&chip->dev);
	u32 clkrun_val;

	if (!IS_ENABLED(CONFIG_X86) || !is_bsw() ||
	    !data->ilb_base_addr)
		return;

I think a safe conclusion to make that chip->ops is NULL, and causes the
panic.

> It looks a lot like an issue that is described here with a TPM 1.2 :
> https://chromium.googlesource.com/chromiumos/third_party/kernel/+/01d1d6e2a1a74b9b8acba7d5eee67fe83e914aa1


I get:

"NOT_FOUND: Requested entity was not found"

Please try out with the mainline kernel. I only now spotted that you are
using a really old kernel. And I have no idea how patched the kernel is.

I misread last time that this happening with the mainline kernel. Debugging
downstream kernel is unfortunately out-of-scope.

When you have test data with the latest unpatched mainline kernel, it makes
sense to look this further.


/Jarkko



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux