Commit 0f751396 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'tpmdd-next-20200316' of git://git.infradead.org/users/jjs/linux-tpmdd

Pull tpm updates from Jarkko Sakkinen:
 "tpmdd updates for Linux v5.7"

* tag 'tpmdd-next-20200316' of git://git.infradead.org/users/jjs/linux-tpmdd:
  KEYS: reaching the keys quotas correctly
  tpm: ibmvtpm: Add support for TPM2
  tpm: ibmvtpm: Wait for buffer to be set before proceeding
  tpm: of: Handle IBM,vtpm20 case when getting log parameters
  MAINTAINERS: adjust to trusted keys subsystem creation
  tpm: tpm_tis_spi_cr50: use new structure for SPI transfer delays
  tpm_tis_spi: use new 'delay' structure for SPI transfer delays
  tpm: tpm2_bios_measurements_next should increase position index
  tpm: tpm1_bios_measurements_next should increase position index
  tpm: Don't make log failures fatal
parents 7111951b 2e356101
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -9280,8 +9280,8 @@ L: keyrings@vger.kernel.org
S:	Supported
F:	Documentation/security/keys/trusted-encrypted.rst
F:	include/keys/trusted-type.h
F:	security/keys/trusted.c
F:	include/keys/trusted.h
F:	include/keys/trusted_tpm.h
F:	security/keys/trusted-keys/
KEYS/KEYRINGS
M:	David Howells <dhowells@redhat.com>
+4 −8
Original line number Diff line number Diff line
@@ -99,11 +99,8 @@ static int tpm_read_log(struct tpm_chip *chip)
 *
 * If an event log is found then the securityfs files are setup to
 * export it to userspace, otherwise nothing is done.
 *
 * Returns -ENODEV if the firmware has no event log or securityfs is not
 * supported.
 */
int tpm_bios_log_setup(struct tpm_chip *chip)
void tpm_bios_log_setup(struct tpm_chip *chip)
{
	const char *name = dev_name(&chip->dev);
	unsigned int cnt;
@@ -112,7 +109,7 @@ int tpm_bios_log_setup(struct tpm_chip *chip)

	rc = tpm_read_log(chip);
	if (rc < 0)
		return rc;
		return;
	log_version = rc;

	cnt = 0;
@@ -158,13 +155,12 @@ int tpm_bios_log_setup(struct tpm_chip *chip)
		cnt++;
	}

	return 0;
	return;

err:
	rc = PTR_ERR(chip->bios_dir[cnt]);
	chip->bios_dir[cnt] = NULL;
	tpm_bios_log_teardown(chip);
	return rc;
	return;
}

void tpm_bios_log_teardown(struct tpm_chip *chip)
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ int tpm_read_log_of(struct tpm_chip *chip)
	 * endian format. For this reason, vtpm doesn't need conversion
	 * but physical tpm needs the conversion.
	 */
	if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0) {
	if (of_property_match_string(np, "compatible", "IBM,vtpm") < 0 &&
	    of_property_match_string(np, "compatible", "IBM,vtpm20") < 0) {
		size = be32_to_cpup((__force __be32 *)sizep);
		base = be64_to_cpup((__force __be64 *)basep);
	} else {
+1 −1
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@ static void *tpm1_bios_measurements_next(struct seq_file *m, void *v,
	u32 converted_event_size;
	u32 converted_event_type;

	(*pos)++;
	converted_event_size = do_endian_conversion(event->event_size);

	v += sizeof(struct tcpa_event) + converted_event_size;
@@ -132,7 +133,6 @@ static void *tpm1_bios_measurements_next(struct seq_file *m, void *v,
	    ((v + sizeof(struct tcpa_event) + converted_event_size) > limit))
		return NULL;

	(*pos)++;
	return v;
}

+1 −1
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ static void *tpm2_bios_measurements_next(struct seq_file *m, void *v,
	size_t event_size;
	void *marker;

	(*pos)++;
	event_header = log->bios_event_log;

	if (v == SEQ_START_TOKEN) {
@@ -118,7 +119,6 @@ static void *tpm2_bios_measurements_next(struct seq_file *m, void *v,
	if (((v + event_size) >= limit) || (event_size == 0))
		return NULL;

	(*pos)++;
	return v;
}

Loading