Skip to contentSkip to conversation

tpm: add bios measurement log

PATCH New Kylene Jo Hall 1 participant 1 message Nov 23, 2005 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tpm: add bios measurement log

According to the TCG specifications measurements or hashes of the BIOS code and data are extended into TPM PCRS and a log is kept in an ACPI table of these extensions for later validation if desired. This patch exports the values in the ACPI table through a security-fs seq_file.

Signed-off-by Reiner Sailer <sailer

---

drivers/char/tpm/Makefile +3 -0
diff -uprbBN --exclude='*.o' --exclude='*.ko' --exclude='*.orig' --exclude='*.rej' --exclude='.*' --exclude='*~' --exclude='tpm_logical*' --exclude=Kconfig linux-2.6.15-rc2/drivers/char/tpm/Makefile linux-2.6.15-rc1/drivers/char/tpm/Makefile
@@ -2,6 +2,9 @@
 # Makefile for the kernel tpm device drivers.
 #
 obj-$(CONFIG_TCG_TPM) += tpm.o
+ifdef CONFIG_ACPI
+	obj-$(CONFIG_TCG_TPM) += tpm_bios.o
+endif
 obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
 obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
 obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o

diff -uprbBN --exclude='*.o' --exclude='*.ko' --exclude='*.orig' --exclude='*.rej' --exclude='.*' --exclude='*~' --exclude='tpm_logical*' --exclude=Kconfig linux-2.6.15-rc2/drivers/char/tpm/tpm_bios.c linux-2.6.15-rc1/drivers/char/tpm/tpm_bios.c

drivers/char/tpm/tpm.c +3 -0
diff -uprbBN --exclude='*.o' --exclude='*.ko' --exclude='*.orig' --exclude='*.rej' --exclude='.*' --exclude='*~' --exclude='tpm_logical*' --exclude=Kconfig linux-2.6.15-rc2/drivers/char/tpm/tpm.c linux-2.6.15-rc1/drivers/char/tpm/tpm.c
@@ -466,6 +556,7 @@ void tpm_remove_hardware(struct device *
 	kfree(chip->vendor->miscdev.name);
 
 	sysfs_remove_group(&dev->kobj, chip->vendor->attr_group);
+	tpm_bios_log_teardown(chip->bios_dir);
 
 	dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &=
 		~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
@@ -593,6 +684,8 @@ dev_num_search_complete:
 
 	sysfs_create_group(&dev->kobj, chip->vendor->attr_group);
 
+	chip->bios_dir = tpm_bios_log_setup(devname);
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(tpm_register_hardware);
drivers/char/tpm/tpm.h +15 -0
diff -uprbBN --exclude='*.o' --exclude='*.ko' --exclude='*.orig' --exclude='*.rej' --exclude='.*' --exclude='*~' --exclude='tpm_logical*' --exclude=Kconfig linux-2.6.15-rc2/drivers/char/tpm/tpm.h linux-2.6.15-rc1/drivers/char/tpm/tpm.h
@@ -82,6 +85,8 @@ struct tpm_chip {
 
 	struct tpm_vendor_specific *vendor;
 
+	struct dentry **bios_dir;
+
 	struct list_head list;
 };
 
@@ -107,3 +112,16 @@ extern ssize_t tpm_read(struct file *, c
 extern void tpm_remove_hardware(struct device *);
 extern int tpm_pm_suspend(struct device *, pm_message_t);
 extern int tpm_pm_resume(struct device *);
+
+#ifdef CONFIG_ACPI
+extern struct dentry**  tpm_bios_log_setup(char*);
+extern void tpm_bios_log_teardown(struct dentry**);
+#else
+static inline struct dentry* tpm_bios_log_setup(char* name)
+{
+	return NULL;
+}
+static inline void tpm_bios_log_teardown(struct dentry** dir)
+{
+}
+#endif
drivers/char/tpm/tpm_bios.c +504 -0

504 lines not on this page · raw message