From: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: jmorris@namei.org, akpm@linux-foundation.org, serue@us.ibm.com,
safford@watson.ibm.com, Mimi Zohar <zohar@linux.vnet.ibm.com>
Subject: [PATCH] TPM: integrity fix
Date: Thu, 5 Feb 2009 13:06:30 -0200 [thread overview]
Message-ID: <1233846390-21146-1-git-send-email-srajiv@linux.vnet.ibm.com> (raw)
Fix to function which is called by IMA, now tpm_chip_find_get() considers the case in which the machine doesn't have a TPM or, if it has, its TPM isn't enabled.
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
---
drivers/char/tpm/tpm.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 0387965..912a473 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -666,18 +666,20 @@ EXPORT_SYMBOL_GPL(tpm_show_temp_deactivated);
*/
static struct tpm_chip *tpm_chip_find_get(int chip_num)
{
- struct tpm_chip *pos;
+ struct tpm_chip *pos, *chip = NULL;
rcu_read_lock();
list_for_each_entry_rcu(pos, &tpm_chip_list, list) {
if (chip_num != TPM_ANY_NUM && chip_num != pos->dev_num)
continue;
- if (try_module_get(pos->dev->driver->owner))
+ if (try_module_get(pos->dev->driver->owner)) {
+ chip = pos;
break;
+ }
}
rcu_read_unlock();
- return pos;
+ return chip;
}
#define TPM_ORDINAL_PCRREAD cpu_to_be32(21)
--
1.5.6.3
next reply other threads:[~2009-02-05 15:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 15:06 Rajiv Andrade [this message]
2009-02-05 15:26 ` Serge E. Hallyn
2009-02-05 16:05 ` Rajiv Andrade
2009-02-05 22:37 ` James Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1233846390-21146-1-git-send-email-srajiv@linux.vnet.ibm.com \
--to=srajiv@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=safford@watson.ibm.com \
--cc=serue@us.ibm.com \
--cc=zohar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®