From: Jarkko Sakkinen <jarkko@kernel.org>
To: Srish Srinivasan <ssrish@linux.ibm.com>
Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,
James.Bottomley@hansenpartnership.com, zohar@linux.ibm.com,
linux-kernel@vger.kernel.org,
linux-security-module@vger.kernel.org, nayna@linux.ibm.com,
rnsastry@linux.ibm.com
Subject: Re: [PATCH 1/2] keys/trusted_keys: return immediately after TPM unseal failure
Date: Thu, 10 Sep 2026 00:05:00 +0300 [thread overview]
Message-ID: <aqHJ_HlQDyldmPRR@kernel.org> (raw)
In-Reply-To: <b2d390dd-3ba0-4faf-967b-d1188da12e62@linux.ibm.com>
On Thu, Sep 03, 2026 at 03:54:38AM +0530, Srish Srinivasan wrote:
>
> On 9/2/26 4:01 PM, Srish Srinivasan wrote:
> > trusted_tpm_unseal() proceeds to pcrlock() when the TPM unseal operation
> > fails. If pcrlock() succeeds, its return value overwrites the unseal error,
> > causing key instantiation to succeed.
> >
> > Return immediately when unseal fails to preserve the original error.
> >
> > Fixes: 5d0682be3189 ("KEYS: trusted: Add generic trusted keys framework")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Srish Srinivasan <ssrish@linux.ibm.com>
> > ---
> > security/keys/trusted-keys/trusted_tpm1.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/security/keys/trusted-keys/trusted_tpm1.c b/security/keys/trusted-keys/trusted_tpm1.c
> > index bf0bf7f36970..1168ca235205 100644
> > --- a/security/keys/trusted-keys/trusted_tpm1.c
> > +++ b/security/keys/trusted-keys/trusted_tpm1.c
> > @@ -923,8 +923,10 @@ static int trusted_tpm_unseal(struct trusted_key_payload *p, char *datablob)
> > ret = tpm2_unseal_trusted(chip, p, options);
> > else
> > ret = key_unseal(p, options);
> > - if (ret < 0)
> > + if (ret < 0) {
> > pr_info("key_unseal failed (%d)\n", ret);
> > + return ret;
>
>
> This should be "goto out;"
> will fix this in my next version
OK, remove my reviewed-by from 1/2 so that I remember to check it
properly
>
>
> > + }
> > if (options->pcrlock) {
> > ret = pcrlock(options->pcrlock);
You can retain r-by in 2/2.
BR, Jarkko
next prev parent reply other threads:[~2026-09-09 21:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 10:31 [PATCH v6 0/2] Move TPM-specific fields out of trusted_key_options Srish Srinivasan
2026-09-02 10:31 ` [PATCH 1/2] keys/trusted_keys: return immediately after TPM unseal failure Srish Srinivasan
2026-09-02 22:24 ` Srish Srinivasan
2026-09-09 21:05 ` Jarkko Sakkinen [this message]
2026-09-09 21:02 ` Jarkko Sakkinen
2026-09-02 10:31 ` [PATCH v6 2/2] keys/trusted_keys: move TPM-specific fields into struct trusted_key_tpm Srish Srinivasan
2026-09-09 21:04 ` 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=aqHJ_HlQDyldmPRR@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=nayna@linux.ibm.com \
--cc=rnsastry@linux.ibm.com \
--cc=ssrish@linux.ibm.com \
--cc=zohar@linux.ibm.com \
/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
all inboxes | Powered by JetHome®