diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-23 21:49:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-23 21:49:06 -0400 |
commit | e05644e17e744315bce12b0948cdc36910b9a76e (patch) | |
tree | 92d62ff59c57f991ef6b5c3cc2c2dcd205946a11 /drivers/char/tpm | |
parent | 97e7292ab5ccd30a13c3612835535fc3f3e59715 (diff) | |
parent | 663728418e3494f8e4a82f5d1b2f23c22d11be35 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem updates from James Morris:
"Nothing groundbreaking for this kernel, just cleanups and fixes, and a
couple of Smack enhancements."
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (21 commits)
Smack: Maintainer Record
Smack: don't show empty rules when /smack/load or /smack/load2 is read
Smack: user access check bounds
Smack: onlycap limits on CAP_MAC_ADMIN
Smack: fix smack_new_inode bogosities
ima: audit is compiled only when enabled
ima: ima_initialized is set only if successful
ima: add policy for pseudo fs
ima: remove unused cleanup functions
ima: free securityfs violations file
ima: use full pathnames in measurement list
security: Fix nommu build.
samples: seccomp: add .gitignore for untracked executables
tpm: check the chip reference before using it
TPM: fix memleak when register hardware fails
TPM: chip disabled state erronously being reported as error
MAINTAINERS: TPM maintainers' contacts update
Merge branches 'next-queue' and 'next' into next
Remove unused code from MPI library
Revert "crypto: GnuPG based MPI lib - additional sources (part 4)"
...
Diffstat (limited to 'drivers/char/tpm')
-rw-r--r-- | drivers/char/tpm/tpm.c | 27 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_infineon.c | 6 |
2 files changed, 23 insertions, 10 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index ae43ac55fc1e..817f0ee202b6 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -827,10 +827,10 @@ EXPORT_SYMBOL_GPL(tpm_pcr_extend); | |||
827 | int tpm_do_selftest(struct tpm_chip *chip) | 827 | int tpm_do_selftest(struct tpm_chip *chip) |
828 | { | 828 | { |
829 | int rc; | 829 | int rc; |
830 | u8 digest[TPM_DIGEST_SIZE]; | ||
831 | unsigned int loops; | 830 | unsigned int loops; |
832 | unsigned int delay_msec = 1000; | 831 | unsigned int delay_msec = 1000; |
833 | unsigned long duration; | 832 | unsigned long duration; |
833 | struct tpm_cmd_t cmd; | ||
834 | 834 | ||
835 | duration = tpm_calc_ordinal_duration(chip, | 835 | duration = tpm_calc_ordinal_duration(chip, |
836 | TPM_ORD_CONTINUE_SELFTEST); | 836 | TPM_ORD_CONTINUE_SELFTEST); |
@@ -845,7 +845,15 @@ int tpm_do_selftest(struct tpm_chip *chip) | |||
845 | return rc; | 845 | return rc; |
846 | 846 | ||
847 | do { | 847 | do { |
848 | rc = __tpm_pcr_read(chip, 0, digest); | 848 | /* Attempt to read a PCR value */ |
849 | cmd.header.in = pcrread_header; | ||
850 | cmd.params.pcrread_in.pcr_idx = cpu_to_be32(0); | ||
851 | rc = tpm_transmit(chip, (u8 *) &cmd, READ_PCR_RESULT_SIZE); | ||
852 | |||
853 | if (rc < TPM_HEADER_SIZE) | ||
854 | return -EFAULT; | ||
855 | |||
856 | rc = be32_to_cpu(cmd.header.out.return_code); | ||
849 | if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { | 857 | if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) { |
850 | dev_info(chip->dev, | 858 | dev_info(chip->dev, |
851 | "TPM is disabled/deactivated (0x%X)\n", rc); | 859 | "TPM is disabled/deactivated (0x%X)\n", rc); |
@@ -1322,6 +1330,9 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume); | |||
1322 | 1330 | ||
1323 | void tpm_dev_vendor_release(struct tpm_chip *chip) | 1331 | void tpm_dev_vendor_release(struct tpm_chip *chip) |
1324 | { | 1332 | { |
1333 | if (!chip) | ||
1334 | return; | ||
1335 | |||
1325 | if (chip->vendor.release) | 1336 | if (chip->vendor.release) |
1326 | chip->vendor.release(chip->dev); | 1337 | chip->vendor.release(chip->dev); |
1327 | 1338 | ||
@@ -1339,6 +1350,9 @@ void tpm_dev_release(struct device *dev) | |||
1339 | { | 1350 | { |
1340 | struct tpm_chip *chip = dev_get_drvdata(dev); | 1351 | struct tpm_chip *chip = dev_get_drvdata(dev); |
1341 | 1352 | ||
1353 | if (!chip) | ||
1354 | return; | ||
1355 | |||
1342 | tpm_dev_vendor_release(chip); | 1356 | tpm_dev_vendor_release(chip); |
1343 | 1357 | ||
1344 | chip->release(dev); | 1358 | chip->release(dev); |
@@ -1405,15 +1419,12 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, | |||
1405 | "unable to misc_register %s, minor %d\n", | 1419 | "unable to misc_register %s, minor %d\n", |
1406 | chip->vendor.miscdev.name, | 1420 | chip->vendor.miscdev.name, |
1407 | chip->vendor.miscdev.minor); | 1421 | chip->vendor.miscdev.minor); |
1408 | put_device(chip->dev); | 1422 | goto put_device; |
1409 | return NULL; | ||
1410 | } | 1423 | } |
1411 | 1424 | ||
1412 | if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) { | 1425 | if (sysfs_create_group(&dev->kobj, chip->vendor.attr_group)) { |
1413 | misc_deregister(&chip->vendor.miscdev); | 1426 | misc_deregister(&chip->vendor.miscdev); |
1414 | put_device(chip->dev); | 1427 | goto put_device; |
1415 | |||
1416 | return NULL; | ||
1417 | } | 1428 | } |
1418 | 1429 | ||
1419 | chip->bios_dir = tpm_bios_log_setup(devname); | 1430 | chip->bios_dir = tpm_bios_log_setup(devname); |
@@ -1425,6 +1436,8 @@ struct tpm_chip *tpm_register_hardware(struct device *dev, | |||
1425 | 1436 | ||
1426 | return chip; | 1437 | return chip; |
1427 | 1438 | ||
1439 | put_device: | ||
1440 | put_device(chip->dev); | ||
1428 | out_free: | 1441 | out_free: |
1429 | kfree(chip); | 1442 | kfree(chip); |
1430 | kfree(devname); | 1443 | kfree(devname); |
diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c index 76da32e11f18..3251a44e8ceb 100644 --- a/drivers/char/tpm/tpm_infineon.c +++ b/drivers/char/tpm/tpm_infineon.c | |||
@@ -4,8 +4,8 @@ | |||
4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module | 4 | * SLD 9630 TT 1.1 and SLB 9635 TT 1.2 Trusted Platform Module |
5 | * Specifications at www.trustedcomputinggroup.org | 5 | * Specifications at www.trustedcomputinggroup.org |
6 | * | 6 | * |
7 | * Copyright (C) 2005, Marcel Selhorst <m.selhorst@sirrix.com> | 7 | * Copyright (C) 2005, Marcel Selhorst <tpmdd@selhorst.net> |
8 | * Sirrix AG - security technologies, http://www.sirrix.com and | 8 | * Sirrix AG - security technologies <tpmdd@sirrix.com> and |
9 | * Applied Data Security Group, Ruhr-University Bochum, Germany | 9 | * Applied Data Security Group, Ruhr-University Bochum, Germany |
10 | * Project-Homepage: http://www.trust.rub.de/projects/linux-device-driver-infineon-tpm/ | 10 | * Project-Homepage: http://www.trust.rub.de/projects/linux-device-driver-infineon-tpm/ |
11 | * | 11 | * |
@@ -671,7 +671,7 @@ static void __exit cleanup_inf(void) | |||
671 | module_init(init_inf); | 671 | module_init(init_inf); |
672 | module_exit(cleanup_inf); | 672 | module_exit(cleanup_inf); |
673 | 673 | ||
674 | MODULE_AUTHOR("Marcel Selhorst <m.selhorst@sirrix.com>"); | 674 | MODULE_AUTHOR("Marcel Selhorst <tpmdd@sirrix.com>"); |
675 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); | 675 | MODULE_DESCRIPTION("Driver for Infineon TPM SLD 9630 TT 1.1 / SLB 9635 TT 1.2"); |
676 | MODULE_VERSION("1.9.2"); | 676 | MODULE_VERSION("1.9.2"); |
677 | MODULE_LICENSE("GPL"); | 677 | MODULE_LICENSE("GPL"); |