Skip to content

Commit 55a82ab

Browse files
Kylene Jo HallLinus Torvalds
Kylene Jo Hall
authored and
Linus Torvalds
committed
[PATCH] 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: Seiji Munetoh <munetoh@jp.ibm.com> Signed-off-by: Stefan Berger <stefanb@us.ibm.com> Signed-off-by: Reiner Sailer <sailer@us.ibm.com> Signed-off-by: Kylene Hall <kjhall@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 485a643 commit 55a82ab

File tree

5 files changed

+531
-0
lines changed

5 files changed

+531
-0
lines changed

drivers/acpi/osl.c

+2
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,13 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size,
204204

205205
return AE_OK;
206206
}
207+
EXPORT_SYMBOL_GPL(acpi_os_map_memory);
207208

208209
void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
209210
{
210211
iounmap(virt);
211212
}
213+
EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);
212214

213215
#ifdef ACPI_FUTURE_USAGE
214216
acpi_status

drivers/char/tpm/Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Makefile for the kernel tpm device drivers.
33
#
44
obj-$(CONFIG_TCG_TPM) += tpm.o
5+
ifdef CONFIG_ACPI
6+
obj-$(CONFIG_TCG_TPM) += tpm_bios.o
7+
endif
58
obj-$(CONFIG_TCG_NSC) += tpm_nsc.o
69
obj-$(CONFIG_TCG_ATMEL) += tpm_atmel.o
710
obj-$(CONFIG_TCG_INFINEON) += tpm_infineon.o

drivers/char/tpm/tpm.c

+3
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ void tpm_remove_hardware(struct device *dev)
466466
kfree(chip->vendor->miscdev.name);
467467

468468
sysfs_remove_group(&dev->kobj, chip->vendor->attr_group);
469+
tpm_bios_log_teardown(chip->bios_dir);
469470

470471
dev_mask[chip->dev_num / TPM_NUM_MASK_ENTRIES ] &=
471472
~(1 << (chip->dev_num % TPM_NUM_MASK_ENTRIES));
@@ -593,6 +594,8 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)
593594

594595
sysfs_create_group(&dev->kobj, chip->vendor->attr_group);
595596

597+
chip->bios_dir = tpm_bios_log_setup(devname);
598+
596599
return 0;
597600
}
598601
EXPORT_SYMBOL_GPL(tpm_register_hardware);

drivers/char/tpm/tpm.h

+15
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ struct tpm_chip {
8282

8383
struct tpm_vendor_specific *vendor;
8484

85+
struct dentry **bios_dir;
86+
8587
struct list_head list;
8688
};
8789

@@ -107,3 +109,16 @@ extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *);
107109
extern void tpm_remove_hardware(struct device *);
108110
extern int tpm_pm_suspend(struct device *, pm_message_t);
109111
extern int tpm_pm_resume(struct device *);
112+
113+
#ifdef CONFIG_ACPI
114+
extern struct dentry ** tpm_bios_log_setup(char *);
115+
extern void tpm_bios_log_teardown(struct dentry **);
116+
#else
117+
static inline struct dentry* tpm_bios_log_setup(char *name)
118+
{
119+
return NULL;
120+
}
121+
static inline void tpm_bios_log_teardown(struct dentry **dir)
122+
{
123+
}
124+
#endif

0 commit comments

Comments
 (0)