From: Jarkko Sakkinen <jarkko@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
error27@gmail.com, Peter Huewe <peterhuewe@gmx.de>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] tpm: Fix a possible dereference of ERR_PTR in tpm_init()
Date: Thu, 30 Mar 2023 00:59:21 +0300 [thread overview]
Message-ID: <20230329215921.2yjebtrscuo66km2@kernel.org> (raw)
In-Reply-To: <ZBlkRCWAJXWkTQI2@kroah.com>
On Tue, Mar 21, 2023 at 09:01:08AM +0100, Greg Kroah-Hartman wrote:
> On Mon, Mar 20, 2023 at 11:14:15PM -0700, Harshit Mogalapalli wrote:
> > Smatch reports:
> > drivers/char/tpm/tpm-interface.c:470 tpm_init() error:
> > 'tpm_class' dereferencing possible ERR_PTR()
> >
> > If class_create() returns error pointer, we are dereferencing a possible
> > error pointer. Fix this by moving the dereference post error handling.
> >
> > Fixes: a010eb881243 ("tpm: fix up the tpm_class shutdown_pre pointer when created")
> > Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> > ---
> > This is based on static analysis, only compile tested.
>
> Thanks for this, good catch, I've queued it up in my tree now as I have
> the offending change that caused this.
OK, thank you!
BR, Jarkko
next prev parent reply other threads:[~2023-03-29 21:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 6:14 [PATCH next] tpm: Fix a possible dereference of ERR_PTR in tpm_init() Harshit Mogalapalli
2023-03-21 8:01 ` Greg Kroah-Hartman
2023-03-29 21:59 ` Jarkko Sakkinen [this message]
2023-03-29 21:59 ` Jarkko Sakkinen
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=20230329215921.2yjebtrscuo66km2@kernel.org \
--to=jarkko@kernel.org \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=harshit.m.mogalapalli@oracle.com \
--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