diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 18:18:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 18:18:57 -0400 |
commit | c82ffab9a857f8286ed2b559624b7005a367b638 (patch) | |
tree | a5d0895a0b55c2db1bf36f517ca273e7e0abdf71 /drivers/char/tpm | |
parent | a724eada8c2a7b62463b73ccf73fd0bb6e928aeb (diff) | |
parent | 5224ee086321fec78970e2f2805892d2b34e8957 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
SELinux: do not destroy the avc_cache_nodep
KEYS: Have the garbage collector set its timer for live expired keys
tpm-fixup-pcrs-sysfs-file-update
creds_are_invalid() needs to be exported for use by modules:
include/linux/cred.h: fix build
Fix trivial BUILD_BUG_ON-induced conflicts in drivers/char/tpm/tpm.c
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r-- | drivers/char/tpm/tpm.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 32b957efa420..45d58002b06c 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -742,7 +742,7 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read); | |||
742 | * the module usage count. | 742 | * the module usage count. |
743 | */ | 743 | */ |
744 | #define TPM_ORD_PCR_EXTEND cpu_to_be32(20) | 744 | #define TPM_ORD_PCR_EXTEND cpu_to_be32(20) |
745 | #define EXTEND_PCR_SIZE 34 | 745 | #define EXTEND_PCR_RESULT_SIZE 34 |
746 | static struct tpm_input_header pcrextend_header = { | 746 | static struct tpm_input_header pcrextend_header = { |
747 | .tag = TPM_TAG_RQU_COMMAND, | 747 | .tag = TPM_TAG_RQU_COMMAND, |
748 | .length = cpu_to_be32(34), | 748 | .length = cpu_to_be32(34), |
@@ -760,10 +760,9 @@ int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) | |||
760 | return -ENODEV; | 760 | return -ENODEV; |
761 | 761 | ||
762 | cmd.header.in = pcrextend_header; | 762 | cmd.header.in = pcrextend_header; |
763 | BUG_ON(be32_to_cpu(cmd.header.in.length) > EXTEND_PCR_SIZE); | ||
764 | cmd.params.pcrextend_in.pcr_idx = cpu_to_be32(pcr_idx); | 763 | cmd.params.pcrextend_in.pcr_idx = cpu_to_be32(pcr_idx); |
765 | memcpy(cmd.params.pcrextend_in.hash, hash, TPM_DIGEST_SIZE); | 764 | memcpy(cmd.params.pcrextend_in.hash, hash, TPM_DIGEST_SIZE); |
766 | rc = transmit_cmd(chip, &cmd, cmd.header.in.length, | 765 | rc = transmit_cmd(chip, &cmd, EXTEND_PCR_RESULT_SIZE, |
767 | "attempting extend a PCR value"); | 766 | "attempting extend a PCR value"); |
768 | 767 | ||
769 | module_put(chip->dev->driver->owner); | 768 | module_put(chip->dev->driver->owner); |