Skip to content

Commit

Permalink
[PATCH] tpm: add bios measurement log
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kylene Jo Hall authored and Linus Torvalds committed Jan 9, 2006
1 parent 485a643 commit 55a82ab
Show file tree
Hide file tree
Showing 5 changed files with 531 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,13 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size,

return AE_OK;
}
EXPORT_SYMBOL_GPL(acpi_os_map_memory);

void acpi_os_unmap_memory(void __iomem * virt, acpi_size size)
{
iounmap(virt);
}
EXPORT_SYMBOL_GPL(acpi_os_unmap_memory);

#ifdef ACPI_FUTURE_USAGE
acpi_status
Expand Down
3 changes: 3 additions & 0 deletions drivers/char/tpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions drivers/char/tpm/tpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ void tpm_remove_hardware(struct device *dev)
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));
Expand Down Expand Up @@ -593,6 +594,8 @@ int tpm_register_hardware(struct device *dev, struct tpm_vendor_specific *entry)

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);
Expand Down
15 changes: 15 additions & 0 deletions drivers/char/tpm/tpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ struct tpm_chip {

struct tpm_vendor_specific *vendor;

struct dentry **bios_dir;

struct list_head list;
};

Expand All @@ -107,3 +109,16 @@ extern ssize_t tpm_read(struct file *, char __user *, size_t, loff_t *);
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
Loading

0 comments on commit 55a82ab

Please sign in to comment.