Skip to contentSkip to conversation

TPM: ACPI/PNP dependency removal

PATCH In review Rajiv Andrade 4 participants 5 messages May 4, 2010 – May 7, 2010 TPM device driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 TPM: ACPI/PNP dependency removal

This patch pushes the ACPI dependency into the device driver code itself. Now, even without ACPI/PNP enabled, the device can be registered using the TIS specified memory space. This will however result in the lack of access to the bios event log, being the only implication of such ACPI removal.

---
 drivers/char/tpm/Kconfig   |   14 +++++++++++---
 drivers/char/tpm/tpm_tis.c |   42 ++++++++++++++++++++++--------------------
 2 files changed, 33 insertions(+), 23 deletions(-)
drivers/char/tpm/Kconfig +11 -3
index f5fc64f..0a9ec0b 100644
@@ -17,20 +17,28 @@ menuconfig TCG_TPM
 	  obtained at: <http://sourceforge.net/projects/trousers>.  To 
 	  compile this driver as a module, choose M here; the module 
 	  will be called tpm. If unsure, say N.
-	  Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
-	  and CONFIG_PNPACPI.
+	  Note: For more TPM drivers and BIOS LOG access enable 
+	  CONFIG_PNP, CONFIG_ACPI and CONFIG_PNPACPI.
 
 if TCG_TPM
 
 config TCG_TIS
 	tristate "TPM Interface Specification 1.2 Interface"
-	depends on PNP
 	---help---
 	  If you have a TPM security chip that is compliant with the
 	  TCG TIS 1.2 TPM specification say Yes and it will be accessible
 	  from within Linux.  To compile this driver as a module, choose
 	  M here; the module will be called tpm_tis.
 
+config TCG_BIOS_LOG
+	bool "TPM bios mesurement log"
+	depends on X86
+	select ACPI
+	---help---
+	  ACPI is required for access to bios measurements lists and therefore
+	  to validate the PCR[0] value. So say Yes in case you want this
+	  feature and, consequently, ACPI will be enabled.
+
 config TCG_NSC
 	tristate "National Semiconductor TPM Interface"
 	---help---
drivers/char/tpm/tpm_tis.c +22 -20

69 lines not on this page · raw message

Signature · 1 line
1.6.6.1
#1 lore raw
Quoted 29 lines · On Tue, 04 May 2010 18:49:20 -0300 Rajiv Andrade wrote:

This patch pushes the ACPI dependency into the device driver code itself. Now, even without ACPI/PNP enabled, the device can be registered using the TIS specified memory space. This will however result in the lack of access to the bios event log, being the only implication of such ACPI removal.

---
 drivers/char/tpm/Kconfig   |   14 +++++++++++---
 drivers/char/tpm/tpm_tis.c |   42 ++++++++++++++++++++++--------------------
 2 files changed, 33 insertions(+), 23 deletions(-)
drivers/char/tpm/Kconfig +2 -2
index f5fc64f..0a9ec0b 100644
@@ -17,20 +17,28 @@ menuconfig TCG_TPM
 	  obtained at: <http://sourceforge.net/projects/trousers>.  To 
 	  compile this driver as a module, choose M here; the module 
 	  will be called tpm. If unsure, say N.
-	  Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
-	  and CONFIG_PNPACPI.
+	  Note: For more TPM drivers and BIOS LOG access enable 
+	  CONFIG_PNP, CONFIG_ACPI and CONFIG_PNPACPI.
 
 if TCG_TPM
 
 config TCG_TIS

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 34

Quoted 10 lines
drivers/char/tpm/Kconfig +2 -1
 	tristate "TPM Interface Specification 1.2 Interface"
-	depends on PNP
 	---help---
 	  If you have a TPM security chip that is compliant with the
 	  TCG TIS 1.2 TPM specification say Yes and it will be accessible
 	  from within Linux.  To compile this driver as a module, choose
 	  M here; the module will be called tpm_tis.
 
+config TCG_BIOS_LOG
+	bool "TPM bios mesurement log"

BIOS measurement

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 38

Quoted 4 lines
drivers/char/tpm/Kconfig +4 -0
+	depends on X86
+	select ACPI
+	---help---
+	  ACPI is required for access to bios measurements lists and therefore

BIOS

and if I had any say-so, I would Nack this part of the patch. Selecting ACPI adds a huge amount of code, so it should just depend on ACPI IMO.

Also, ACPI depends on PCI and PM, so if this "select" part remains, this should be more like:

	  depends on X86 && PCI && PM

(unless that's already enforced somewhere else).

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 44

Quoted 6 lines
drivers/char/tpm/Kconfig +3 -0
+	  to validate the PCR[0] value. So say Yes in case you want this
+	  feature and, consequently, ACPI will be enabled.
+
 config TCG_NSC
 	tristate "National Semiconductor TPM Interface"
 	---help---

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw
Quoted 51 lines · Randy Dunlap
Quoted 29 lines · On Tue, 04 May 2010 18:49:20 -0300 Rajiv Andrade wrote:

This patch pushes the ACPI dependency into the device driver code itself. Now, even without ACPI/PNP enabled, the device can be registered using the TIS specified memory space. This will however result in the lack of access to the bios event log, being the only implication of such ACPI removal.

---
 drivers/char/tpm/Kconfig   |   14 +++++++++++---
 drivers/char/tpm/tpm_tis.c |   42 ++++++++++++++++++++++--------------------
 2 files changed, 33 insertions(+), 23 deletions(-)
drivers/char/tpm/Kconfig +2 -2
index f5fc64f..0a9ec0b 100644
@@ -17,20 +17,28 @@ menuconfig TCG_TPM
 	  obtained at: <http://sourceforge.net/projects/trousers>.  To 
 	  compile this driver as a module, choose M here; the module 
 	  will be called tpm. If unsure, say N.
-	  Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
-	  and CONFIG_PNPACPI.
+	  Note: For more TPM drivers and BIOS LOG access enable 
+	  CONFIG_PNP, CONFIG_ACPI and CONFIG_PNPACPI.
 
 if TCG_TPM
 
 config TCG_TIS

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 34

Quoted 10 lines
drivers/char/tpm/Kconfig +2 -1
 	tristate "TPM Interface Specification 1.2 Interface"
-	depends on PNP
 	---help---
 	  If you have a TPM security chip that is compliant with the
 	  TCG TIS 1.2 TPM specification say Yes and it will be accessible
 	  from within Linux.  To compile this driver as a module, choose
 	  M here; the module will be called tpm_tis.
 
+config TCG_BIOS_LOG
+	bool "TPM bios mesurement log"

BIOS measurement

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 38

Quoted 4 lines
drivers/char/tpm/Kconfig +4 -0
+	depends on X86
+	select ACPI
+	---help---
+	  ACPI is required for access to bios measurements lists and therefore

BIOS

Quoted 2 lines

and if I had any say-so, I would Nack this part of the patch. Selecting ACPI adds a huge amount of code, so it should just depend on ACPI IMO.

Just posted a patch removing the ACPI dependency from IMA, as IMA can run with/without ACPI or TPM enabled. However, without ACPI enabled, the PCR values can not be verified against the BIOS measurement log.

Quoted 6 lines

Also, ACPI depends on PCI and PM, so if this "select" part remains, this should be more like:

	  depends on X86 && PCI && PM

(unless that's already enforced somewhere else).

Thanks.

Quoted 6 lines

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 44

Quoted 6 lines
drivers/char/tpm/Kconfig +3 -0
+	  to validate the PCR[0] value. So say Yes in case you want this
+	  feature and, consequently, ACPI will be enabled.
+
 config TCG_NSC
 	tristate "National Semiconductor TPM Interface"
 	---help---

Mimi

#3 lore raw
In reply to Randy Dunlap
Quoted 54 lines · Randy Dunlap
Quoted 37 lines · On Tue, 04 May 2010 18:49:20 -0300 Rajiv Andrade wrote:

This patch pushes the ACPI dependency into the device driver code itself. Now, even without ACPI/PNP enabled, the device can be registered using the TIS specified memory space. This will however result in the lack of access to the bios event log, being the only implication of such ACPI removal.

---

drivers/char/tpm/Kconfig   |   14 +++++++++++---
drivers/char/tpm/tpm_tis.c |   42 ++++++++++++++++++++++--------------------
2 files changed, 33 insertions(+), 23 deletions(-)
drivers/char/tpm/Kconfig +2 -2
index f5fc64f..0a9ec0b 100644
@@ -17,20 +17,28 @@ menuconfig TCG_TPM
 	  obtained at: <http://sourceforge.net/projects/trousers>.  To 
 	  compile this driver as a module, choose M here; the module 
 	  will be called tpm. If unsure, say N.
-	  Note: For more TPM drivers enable CONFIG_PNP, CONFIG_ACPI
-	  and CONFIG_PNPACPI.
+	  Note: For more TPM drivers and BIOS LOG access enable 
+	  CONFIG_PNP, CONFIG_ACPI and CONFIG_PNPACPI.
 

if TCG_TPM

config TCG_TIS
tristate "TPM Interface Specification 1.2 Interface"

drivers/char/tpm/Kconfig +0 -1
-	depends on PNP

---help---
If you have a TPM security chip that is compliant with the TCG TIS 1.2 TPM specification say Yes and it will be accessible from within Linux. To compile this driver as a module, choose M here; the module will be called tpm_tis.

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 34

Quoted 2 lines
drivers/char/tpm/Kconfig +2 -0
+config TCG_BIOS_LOG
+	bool "TPM bios mesurement log"

BIOS measurement

drivers/char/tpm/Kconfig menuconfig TCG_TPM · line 38

Quoted 4 lines
drivers/char/tpm/Kconfig +4 -0
+	depends on X86
+	select ACPI
+	---help---
+	  ACPI is required for access to bios measurements lists and therefore

BIOS

and if I had any say-so, I would Nack this part of the patch. Selecting ACPI adds a huge amount of code, so it should just depend on ACPI IMO.

Quoted 6 lines

Also, ACPI depends on PCI and PM, so if this "select" part remains, this should be more like:

	  depends on X86 && PCI && PM

(unless that's already enforced somewhere else).

Ok, this option here was just to enforce the warning 'You won't be able to validate PCRs 0-7 if without ACPI enabled'. I'll then just document this and remove this option. In the end, we'll be left with the ACPI code and Kconfig dependency removal from the TPM device driver.

Thanks,
Rajiv

#4 lore raw
In reply to Rajiv Andrade
Quoted 8 lines · Rajiv Andrade

This patch pushes the ACPI dependency into the device driver code itself. Now, even without ACPI/PNP enabled, the device can be registered using the TIS specified memory space. This will however result in the lack of access to the bios event log, being the only implication of such ACPI removal.

Applied to
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next

Signature · 2 lines
James Morris
<[email protected]>