[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <B816AE7F-E224-4203-9B21-99310D49040D@linux.vnet.ibm.com>
Date: Mon, 20 Dec 2021 10:47:13 +0530
From: Sachin Sant <sachinp@...ux.vnet.ibm.com>
To: Stefan Berger <stefanb@...ux.ibm.com>
Cc: jarkko@...nel.org, peterhuewe@....de,
linux-integrity@...r.kernel.org, Korrapati.Likhitha@....com,
pavrampu@...ibm.com, linux-kernel@...r.kernel.org, jgg@...pe.ca,
linux-security-module@...r.kernel.org, gcwilson@...ibm.com,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] tpm: Fix kexec crash due to access to ops NULL pointer
(powerpc)
> On 12-Dec-2021, at 6:58 AM, Stefan Berger <stefanb@...ux.ibm.com> wrote:
>
> Fix the following crash on kexec by checking chip->ops for a NULL pointer
> in tpm_chip_start() and returning an error code if this is the case.
>
> BUG: Kernel NULL pointer dereference on read at 0x00000060
> Faulting instruction address: 0xc00000000099a06c
> Oops: Kernel access of bad area, sig: 11 [#1]
> ...
> NIP [c00000000099a06c] tpm_chip_start+0x2c/0x140
> LR [c00000000099a808] tpm_chip_unregister+0x108/0x170
> Call Trace:
> [c0000000188bfa00] [c000000002b03930] fw_devlink_strict+0x0/0x8 (unreliable)
> [c0000000188bfa30] [c00000000099a808] tpm_chip_unregister+0x108/0x170
> [c0000000188bfa70] [c0000000009a3874] tpm_ibmvtpm_remove+0x34/0x130
> [c0000000188bfae0] [c000000000110dbc] vio_bus_remove+0x5c/0xb0
> [c0000000188bfb20] [c0000000009bc154] device_shutdown+0x1d4/0x3a8
> [c0000000188bfbc0] [c000000000196e14] kernel_restart_prepare+0x54/0x70
>
> The referenced patch below introduced a function to shut down the VIO bus.
> The bus shutdown now calls tpm_del_char_device (via tpm_chip_unregister)
> after a call to tpm_class_shutdown, which already set chip->ops to NULL.
> The crash occurrs when tpm_del_char_device calls tpm_chip_start with the
> chip->ops NULL pointer.
>
> Fixes: 39d0099f9439 ("powerpc/pseries: Add shutdown() to vio_driver and vio_bus")
> Signed-off-by: Stefan Berger <stefanb@...ux.ibm.com>
> ---
With the patch applied, kexec with vTPM works as expected.
Tested-by: Sachin Sant <sachinp@...ux.vnet.ibm.com>
Thanks
-Sachin
Powered by blists - more mailing lists