Linux Documentation
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Evan Green <evgreen@chromium.org>
Cc: linux-kernel@vger.kernel.org, corbet@lwn.net,
	linux-integrity@vger.kernel.org, gwendal@chromium.org,
	dianders@chromium.org, apronin@chromium.org,
	Pavel Machek <pavel@ucw.cz>, Ben Boeckel <me@benboeckel.net>,
	rjw@rjwysocki.net, jejb@linux.ibm.com,
	Kees Cook <keescook@chromium.org>,
	dlunev@google.com, zohar@linux.ibm.com,
	Matthew Garrett <mgarrett@aurora.tech>,
	jarkko@kernel.org, linux-pm@vger.kernel.org,
	Matthew Garrett <matthewgarrett@google.com>,
	Ben Boeckel <linux@me.benboeckel.net>,
	David Howells <dhowells@redhat.com>,
	James Morris <jmorris@namei.org>,
	Paul Moore <paul@paul-moore.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	keyrings@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-security-module@vger.kernel.org
Subject: Re: [PATCH v5 05/11] security: keys: trusted: Allow storage of PCR values in creation data
Date: Sun, 13 Nov 2022 14:01:07 -0800	[thread overview]
Message-ID: <Y3FpI4GHO9pHYZUH@sol.localdomain> (raw)
In-Reply-To: <20221111151451.v5.5.I32591db064b6cdc91850d777f363c9d05c985b39@changeid>

On Fri, Nov 11, 2022 at 03:16:30PM -0800, Evan Green wrote:
> +       creationpcrs= hex integer representing the set of PCRs to be
> +                     included in the creation data. For each bit set, the
> +                     corresponding PCR will be included in the key creation
> +                     data. Bit 0 corresponds to PCR0. Currently only the first
> +                     PC standard 24 PCRs are supported on the currently active
> +                     bank. Leading zeroes are optional. TPM2 only.

What does "currently active bank" mean?

> +		/* PCR bitmask */
> +		for (i = 0; i < 3; i++) {
> +			char tmp = 0;
> +
> +			for (j = 0; j < 8; j++) {
> +				char bit = (i * 8) + j;
> +
> +				if (options->creation_pcrs & (1 << bit))
> +					tmp |= (1 << j);
> +			}
> +			tpm_buf_append_u8(&buf, tmp);
> +		}

Why not just:

	tpm_buf_append_u8(&buf, options->creation_pcrs);
	tpm_buf_append_u8(&buf, options->creation_pcrs >> 8);
	tpm_buf_append_u8(&buf, options->creation_pcrs >> 16);

Also what if bit 24 or above is set?  Should an error be returned?

- Eric

  reply	other threads:[~2022-11-13 22:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 23:16 [PATCH v5 00/11] Encrypted Hibernation Evan Green
2022-11-11 23:16 ` [PATCH v5 05/11] security: keys: trusted: Allow storage of PCR values in creation data Evan Green
2022-11-13 22:01   ` Eric Biggers [this message]
2022-12-07 23:54 ` [PATCH v5 00/11] Encrypted Hibernation Evan Green

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=Y3FpI4GHO9pHYZUH@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=apronin@chromium.org \
    --cc=corbet@lwn.net \
    --cc=dhowells@redhat.com \
    --cc=dianders@chromium.org \
    --cc=dlunev@google.com \
    --cc=evgreen@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=jarkko@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=jmorris@namei.org \
    --cc=keescook@chromium.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linux@me.benboeckel.net \
    --cc=matthewgarrett@google.com \
    --cc=me@benboeckel.net \
    --cc=mgarrett@aurora.tech \
    --cc=paul@paul-moore.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=serge@hallyn.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