All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "James Bottomley" <James.Bottomley@HansenPartnership.com>,
	<linux-integrity@vger.kernel.org>
Cc: <keyrings@vger.kernel.org>, <stable@vger.kernel.org>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	"David Howells" <dhowells@redhat.com>,
	"Paul Moore" <paul@paul-moore.com>,
	"James Morris" <jmorris@namei.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	<linux-security-module@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] KEYS: trusted_tpm2: Only check options->keyhandle for ASN.1
Date: Sat, 25 May 2024 18:15:43 +0300	[thread overview]
Message-ID: <D1ITOT1F26RK.S2V3FRMXPAPD@kernel.org> (raw)
In-Reply-To: <b1ac7ec116c871294d856185da44ae1e9fc02fe7.camel@HansenPartnership.com>

On Sat May 25, 2024 at 4:42 PM EEST, James Bottomley wrote:
> On Sat, 2024-05-25 at 15:36 +0300, Jarkko Sakkinen wrote:
> > tpm2_load_cmd incorrectly checks options->keyhandle also for the
> > legacy format, as also implied by the inline comment. Check
> > options->keyhandle when ASN.1 is loaded.
>
> No that's not right.  keyhandle must be specified for the old format,
> because it's just the two private/public blobs and doesn't know it's
> parent. Since tpm2_key_decode() always places the ASN.1 parent into
> options->keyhandle, the proposed new code is fully redundant (options-
> >keyhandle must be non zero if the ASN.1 parsed correctly) but it loses
> the check that the loader must specify it for the old format.
>
> What the comment above the code you removed means is that the keyhandle
> must be non zero here, either extracted from the ASN.1 for the new
> format or specified on the command line for the old.

My code change was plain direct to the word interpreation of the
comment.

So I just take the last paragraph of yours and instead fix the
misleading comment:

/*
 * Keyhandle must be non zero here, either extracted from the ASN.1 for
 * the new format or specified on the command line for the old.
 */

BR, Jarkko

      reply	other threads:[~2024-05-25 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-25 12:36 [PATCH] KEYS: trusted_tpm2: Only check options->keyhandle for ASN.1 Jarkko Sakkinen
2024-05-25 13:42 ` James Bottomley
2024-05-25 15:15   ` 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=D1ITOT1F26RK.S2V3FRMXPAPD@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dhowells@redhat.com \
    --cc=jmorris@namei.org \
    --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=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=stable@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.