mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-26 18:43:33 -05:00
tpmdd fixes for Linux v5.4
-----BEGIN PGP SIGNATURE----- iJYEABYIAD4WIQRE6pSOnaBC00OEHEIaerohdGur0gUCXYqr6iAcamFya2tvLnNh a2tpbmVuQGxpbnV4LmludGVsLmNvbQAKCRAaerohdGur0pspAP9pmSqIde7M2BJD kRmkiannjbl55Ss5+RX+oqOLwtezewEAzgK/vQkm/AWZPqix274qdOMTOX1jjwUZ JnvsxZrEuQc= =l6Vw -----END PGP SIGNATURE----- Merge tag 'tpmdd-next-20190925' of git://git.infradead.org/users/jjs/linux-tpmdd Pull tpm fixes from Jarkko Sakkinen. * tag 'tpmdd-next-20190925' of git://git.infradead.org/users/jjs/linux-tpmdd: tpm: Wrap the buffer from the caller to tpm_buf in tpm_send() MAINTAINERS: keys: Update path to trusted.h KEYS: trusted: correctly initialize digests and fix locking issue selftests/tpm2: Add log and *.pyc to .gitignore selftests/tpm2: Add the missing TEST_FILES assignment
This commit is contained in:
commit
301310c6d2
5 changed files with 20 additions and 13 deletions
|
@ -9056,7 +9056,7 @@ S: Supported
|
||||||
F: Documentation/security/keys/trusted-encrypted.rst
|
F: Documentation/security/keys/trusted-encrypted.rst
|
||||||
F: include/keys/trusted-type.h
|
F: include/keys/trusted-type.h
|
||||||
F: security/keys/trusted.c
|
F: security/keys/trusted.c
|
||||||
F: security/keys/trusted.h
|
F: include/keys/trusted.h
|
||||||
|
|
||||||
KEYS/KEYRINGS:
|
KEYS/KEYRINGS:
|
||||||
M: David Howells <dhowells@redhat.com>
|
M: David Howells <dhowells@redhat.com>
|
||||||
|
|
|
@ -320,18 +320,22 @@ int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx,
|
||||||
if (!chip)
|
if (!chip)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
for (i = 0; i < chip->nr_allocated_banks; i++)
|
for (i = 0; i < chip->nr_allocated_banks; i++) {
|
||||||
if (digests[i].alg_id != chip->allocated_banks[i].alg_id)
|
if (digests[i].alg_id != chip->allocated_banks[i].alg_id) {
|
||||||
return -EINVAL;
|
rc = EINVAL;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
|
if (chip->flags & TPM_CHIP_FLAG_TPM2) {
|
||||||
rc = tpm2_pcr_extend(chip, pcr_idx, digests);
|
rc = tpm2_pcr_extend(chip, pcr_idx, digests);
|
||||||
tpm_put_ops(chip);
|
goto out;
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = tpm1_pcr_extend(chip, pcr_idx, digests[0].digest,
|
rc = tpm1_pcr_extend(chip, pcr_idx, digests[0].digest,
|
||||||
"attempting extend a PCR value");
|
"attempting extend a PCR value");
|
||||||
|
|
||||||
|
out:
|
||||||
tpm_put_ops(chip);
|
tpm_put_ops(chip);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -354,14 +358,9 @@ int tpm_send(struct tpm_chip *chip, void *cmd, size_t buflen)
|
||||||
if (!chip)
|
if (!chip)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
rc = tpm_buf_init(&buf, 0, 0);
|
buf.data = cmd;
|
||||||
if (rc)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
memcpy(buf.data, cmd, buflen);
|
|
||||||
rc = tpm_transmit_cmd(chip, &buf, 0, "attempting to a send a command");
|
rc = tpm_transmit_cmd(chip, &buf, 0, "attempting to a send a command");
|
||||||
tpm_buf_destroy(&buf);
|
|
||||||
out:
|
|
||||||
tpm_put_ops(chip);
|
tpm_put_ops(chip);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1228,11 +1228,16 @@ hashalg_fail:
|
||||||
|
|
||||||
static int __init init_digests(void)
|
static int __init init_digests(void)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests),
|
digests = kcalloc(chip->nr_allocated_banks, sizeof(*digests),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!digests)
|
if (!digests)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
for (i = 0; i < chip->nr_allocated_banks; i++)
|
||||||
|
digests[i].alg_id = chip->allocated_banks[i].alg_id;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
tools/testing/selftests/.gitignore
vendored
2
tools/testing/selftests/.gitignore
vendored
|
@ -2,3 +2,5 @@ gpiogpio-event-mon
|
||||||
gpiogpio-hammer
|
gpiogpio-hammer
|
||||||
gpioinclude/
|
gpioinclude/
|
||||||
gpiolsgpio
|
gpiolsgpio
|
||||||
|
tpm2/SpaceTest.log
|
||||||
|
tpm2/*.pyc
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
include ../lib.mk
|
include ../lib.mk
|
||||||
|
|
||||||
TEST_PROGS := test_smoke.sh test_space.sh
|
TEST_PROGS := test_smoke.sh test_space.sh
|
||||||
|
TEST_FILES := tpm2.py tpm2_tests.py
|
||||||
|
|
Loading…
Add table
Reference in a new issue