Linux-Integrity Archive on lore.kernel.org
 help / color / Atom feed
From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
To: Matthew Garrett <matthewgarrett@google.com>
Cc: linux-integrity@vger.kernel.org, peterhuewe@gmx.de, jgg@ziepe.ca,
	roberto.sassu@huawei.com, Matthew Garrett <mjg59@google.com>
Subject: Re: [PATCH V3 3/4] tpm: Append the final event log to the TPM event log
Date: Wed, 13 Feb 2019 12:46:44 +0200
Message-ID: <20190213104644.GC7087@linux.intel.com> (raw)
In-Reply-To: <20190211215518.81419-4-matthewgarrett@google.com>

On Mon, Feb 11, 2019 at 01:55:17PM -0800, Matthew Garrett wrote:
> +	if (efi.tpm_final_log != EFI_INVALID_TABLE_ADDR &&
> +	    efi_tpm_final_log_size != 0) {
> +		if (tpm_log_version == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {

Instead of nesting code heavily I would just:

if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR ||
    efi_tpm_final_log_size == 0 ||
    tpm_log_version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
    goto out_memunmap;

And in the tail:

out_munmap:
	memunmap(final_tbl);
	memunmap(log_tb);
	return tpm_log_version;

err_munmap:
	memunmap(final_tbl);
	memunmap(log_tb);
	return -ENOMEM;
}

/Jarkko

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 21:55 [PATCH V3] Add support for TPM2 event logs on EFI systems Matthew Garrett
2019-02-11 21:55 ` [PATCH V3 1/4] tpm: Abstract crypto agile event size calculations Matthew Garrett
2019-02-13 10:35   ` Jarkko Sakkinen
2019-02-11 21:55 ` [PATCH V3 2/4] tpm: Reserve the TPM final events table Matthew Garrett
2019-02-13 10:57   ` Jarkko Sakkinen
2019-02-11 21:55 ` [PATCH V3 3/4] tpm: Append the final event log to the TPM event log Matthew Garrett
2019-02-13 10:46   ` Jarkko Sakkinen [this message]
2019-02-11 21:55 ` [PATCH V3 4/4] efi: Attempt to get the TCG2 event log in the boot stub Matthew Garrett
2019-02-13 10:37   ` Jarkko Sakkinen
2019-02-19 11:56 ` [PATCH V3] Add support for TPM2 event logs on EFI systems Jarkko Sakkinen
2019-02-19 11:59   ` Jarkko Sakkinen
2019-02-20 19:28   ` Matthew Garrett
2019-02-21 12:16     ` Jarkko Sakkinen
2019-02-22 19:24       ` Matthew Garrett

Reply instructions:

You may reply publically 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=20190213104644.GC7087@linux.intel.com \
    --to=jarkko.sakkinen@linux.intel.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=matthewgarrett@google.com \
    --cc=mjg59@google.com \
    --cc=peterhuewe@gmx.de \
    --cc=roberto.sassu@huawei.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

Linux-Integrity Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-integrity/0 linux-integrity/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-integrity linux-integrity/ https://lore.kernel.org/linux-integrity \
		linux-integrity@vger.kernel.org linux-integrity@archiver.kernel.org
	public-inbox-index linux-integrity


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-integrity


AGPL code for this site: git clone https://public-inbox.org/ public-inbox