From: Jarkko Sakkinen <jarkko@kernel.org>
To: Patrick Williams <patrick@stwcx.xyz>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
Hao Wu <hao.wu@rubrik.com>,
stable@vger.kernel.org, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tpm: fix NPE on probe for missing device
Date: Wed, 29 Dec 2021 03:38:51 +0200 [thread overview]
Message-ID: <Ycu8KxrunNXvOobG@iki.fi> (raw)
In-Reply-To: <20211223154932.678424-1-patrick@stwcx.xyz>
On Thu, Dec 23, 2021 at 09:49:31AM -0600, Patrick Williams wrote:
> When using the tpm_tis-spi driver on a system missing the physical TPM,
> a null pointer exception was observed.
>
> [ 0.938677] Unable to handle kernel NULL pointer dereference at virtual address 00000004
> [ 0.939020] pgd = 10c753cb
> [ 0.939237] [00000004] *pgd=00000000
> [ 0.939808] Internal error: Oops: 5 [#1] SMP ARM
> [ 0.940157] CPU: 0 PID: 48 Comm: kworker/u4:1 Not tainted 5.15.10-dd1e40c #1
> [ 0.940364] Hardware name: Generic DT based system
> [ 0.940601] Workqueue: events_unbound async_run_entry_fn
> [ 0.941048] PC is at tpm_tis_remove+0x28/0xb4
> [ 0.941196] LR is at tpm_tis_core_init+0x170/0x6ac
>
> This is due to an attempt in 'tpm_tis_remove' to use the drvdata, which
> was not initialized in 'tpm_tis_core_init' prior to the first error.
>
> Move the initialization of drvdata earlier so 'tpm_tis_remove' has
> access to it.
>
> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
> Fixes: 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries")
> Cc: stable@vger.kernel.org
Thank you.
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
/Jarkko
prev parent reply other threads:[~2021-12-29 1:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-23 15:49 [PATCH] tpm: fix NPE on probe for missing device Patrick Williams
2021-12-29 1:38 ` Jarkko Sakkinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Ycu8KxrunNXvOobG@iki.fi \
--to=jarkko@kernel.org \
--cc=hao.wu@rubrik.com \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patrick@stwcx.xyz \
--cc=peterhuewe@gmx.de \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox