diff options
author | 2015-11-12 15:48:10 -0800 | |
---|---|---|
committer | 2015-11-12 15:48:10 -0800 | |
commit | a4d8c7c9f7754405c52c59e1b1e984df5749d7bb (patch) | |
tree | fd2e53ae06ffaaaa96cda893ec01da725878a94a /drivers/char/tpm/tpm-chip.c | |
parent | Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux (diff) | |
parent | X.509: Fix the time validation [ver #2] (diff) | |
download | linux-dev-a4d8c7c9f7754405c52c59e1b1e984df5749d7bb.tar.xz linux-dev-a4d8c7c9f7754405c52c59e1b1e984df5749d7bb.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem fixes from James Morris:
"This includes several fixes for TPM, as well as a fix for the x.509
certificate parser to address CVE-2015-5327"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
X.509: Fix the time validation [ver #2]
tpm: fix compat 'ppi' link handling in tpm_chip_register()
tpm: fix missing migratable flag in sealing functionality for TPM2
TPM: revert the list handling logic fixed in 398a1e7
TPM: Avoid reference to potentially freed memory
tpm_tis: restore IRQ vector in IO memory after failed probing
tpm_tis: free irq after probing
Diffstat (limited to 'drivers/char/tpm/tpm-chip.c')
-rw-r--r-- | drivers/char/tpm/tpm-chip.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index f26b0ae23bea..45cc39aabeee 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -226,21 +226,23 @@ int tpm_chip_register(struct tpm_chip *chip) if (rc) goto out_err; - if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) { - rc = __compat_only_sysfs_link_entry_to_kobj(&chip->pdev->kobj, - &chip->dev.kobj, - "ppi"); - if (rc) - goto out_err; - } - /* Make the chip available. */ spin_lock(&driver_lock); - list_add_rcu(&chip->list, &tpm_chip_list); + list_add_tail_rcu(&chip->list, &tpm_chip_list); spin_unlock(&driver_lock); chip->flags |= TPM_CHIP_FLAG_REGISTERED; + if (!(chip->flags & TPM_CHIP_FLAG_TPM2)) { + rc = __compat_only_sysfs_link_entry_to_kobj(&chip->pdev->kobj, + &chip->dev.kobj, + "ppi"); + if (rc && rc != -ENOENT) { + tpm_chip_unregister(chip); + return rc; + } + } + return 0; out_err: tpm1_chip_unregister(chip); |