From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Andrey Pronin <apronin@chromium.org>
Cc: peterhuewe@gmx.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Guenter Roeck <groeck@chromium.org>
Subject: Re: [PATCH] tpm: avoid accessing cleared ops during shutdown
Date: Tue, 14 Jul 2020 14:32:18 +0300 [thread overview]
Message-ID: <20200714113205.GA1461506@linux.intel.com> (raw)
In-Reply-To: <CAP7wa8LfEtEATbENjr18jTXShT+YmrAoDt4k9FK1SLpxVqViog@mail.gmail.com>
On Fri, Jul 10, 2020 at 11:25:44AM -0700, Andrey Pronin wrote:
> > Why does not tpm_del_char_device need this?
>
> "Not" is a typo in the sentence above, right? tpm_del_char_device *does*
> need the fix. When tpm_class_shutdown is called it sets chip->ops to
> NULL. If tpm_del_char_device is called after that, it doesn't check if
> chip->ops is NULL (normal kernel API and char device API calls go
> through tpm_try_get_ops, but tpm_del_char_device doesn't) and proceeds to
> call tpm2_shutdown(), which tries sending the command and dereferences
> chip->ops.
It's a typo, yes. Sorry about that.
tpm_class_shutdown() is essentially tail of tpm_del_char_device().
To clean things up, I'd suggest dropping tpm_del_char_device() and
call tpm_class_shutdown() in tpm_chip_unregisters() along, and open
coding things that prepend it in tpm_del_char_device().
/Jarkko
next prev parent reply other threads:[~2020-07-14 11:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 0:22 [PATCH] tpm: avoid accessing cleared ops during shutdown Andrey Pronin
2020-07-10 11:40 ` Jarkko Sakkinen
2020-07-10 18:25 ` Andrey Pronin
2020-07-14 11:32 ` Jarkko Sakkinen [this message]
2020-07-14 15:48 ` Guenter Roeck
2020-07-16 17:28 ` Jarkko Sakkinen
2020-07-16 17:38 ` Guenter Roeck
2020-07-23 1:56 ` Jarkko Sakkinen
2020-07-10 19:08 ` James Bottomley
2020-07-10 20:34 ` Andrey Pronin
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=20200714113205.GA1461506@linux.intel.com \
--to=jarkko.sakkinen@linux.intel.com \
--cc=apronin@chromium.org \
--cc=groeck@chromium.org \
--cc=jgg@ziepe.ca \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
/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;
as well as URLs for NNTP newsgroup(s).