From: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Jason Gunthorpe
<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] tpm: Check the bios_dir entry for NULL before accessing it
Date: Wed, 16 Nov 2016 14:08:54 -0800 [thread overview]
Message-ID: <20161116220854.4yrr7rajc2hhs6yw@intel.com> (raw)
In-Reply-To: <20161116220633.yfvpnvps3e222527-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
On Wed, Nov 16, 2016 at 02:06:33PM -0800, Jarkko Sakkinen wrote:
> On Wed, Nov 16, 2016 at 01:38:53PM -0700, Jason Gunthorpe wrote:
> > On Wed, Nov 16, 2016 at 08:56:13AM -0500, Stefan Berger wrote:
> > > Check the bios_dir entry for NULL before accessing it. Currently
> > > this crashes the driver when a TPM 2 is attached and the entries
> > > are NULL.
> >
> > Yep
> >
> > > for (i = (TPM_NUM_EVENT_LOG_FILES - 1); i >= 0; i--) {
> > > - inode = d_inode(chip->bios_dir[i]);
> > > - inode_lock(inode);
> > > - inode->i_private = NULL;
> > > - inode_unlock(inode);
> > > - securityfs_remove(chip->bios_dir[i]);
> > > + if (chip->bios_dir[i]) {
> >
> > Nope, this must be is_err_or_null, we store err ptrs in this array.
>
> "
> err:
> chip->bios_dir[cnt] = NULL;
> "
>
> There is assignment to NULL so this should be fine.
Applied. Not yet squashed. I'll save that for the next week and possible
other squashes to the point when I prepare the pull request.
/Jarkko
------------------------------------------------------------------------------
next prev parent reply other threads:[~2016-11-16 22:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 13:56 [PATCH] tpm: Check the bios_dir entry for NULL before accessing it Stefan Berger
[not found] ` <1479304573-13601-1-git-send-email-stefanb-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-16 14:58 ` Nayna
[not found] ` <582C7416.7090105-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-16 15:40 ` Jarkko Sakkinen
[not found] ` <20161116154027.i6rtsl2mendbb4ce-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16 15:49 ` Stefan Berger
[not found] ` <f4a7d9a4-c832-fd06-6a62-7b800f42585f-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-11-16 17:57 ` Jarkko Sakkinen
2016-11-16 15:38 ` Jarkko Sakkinen
2016-11-16 20:38 ` Jason Gunthorpe
[not found] ` <20161116203853.GA22708-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-11-16 22:06 ` Jarkko Sakkinen
[not found] ` <20161116220633.yfvpnvps3e222527-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-16 22:08 ` Jarkko Sakkinen [this message]
2016-11-16 23:56 ` Jason Gunthorpe
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=20161116220854.4yrr7rajc2hhs6yw@intel.com \
--to=jarkko.sakkinen-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
--cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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;
as well as URLs for NNTP newsgroup(s).