diff mbox

Revert "acpi: tpm2: add check for zero control area address (LP: #1506442)"

Message ID 1461227400-1154-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King April 21, 2016, 8:30 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Turns out that a zero control area address can be zero to indicate that
the Control Area is not required. Kudos to Alex Hung for spotting this issue.

This reverts commit 897b1164b7bfd2b46259906a04190f1cba46c34b.
---
 src/acpi/tpm2/tpm2.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Comments

Alex Hung April 21, 2016, 9:17 a.m. UTC | #1
On 04/21/2016 04:30 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Turns out that a zero control area address can be zero to indicate that
> the Control Area is not required. Kudos to Alex Hung for spotting this issue.
>
> This reverts commit 897b1164b7bfd2b46259906a04190f1cba46c34b.
> ---
>   src/acpi/tpm2/tpm2.c | 14 +-------------
>   1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/src/acpi/tpm2/tpm2.c b/src/acpi/tpm2/tpm2.c
> index f124b02..babbc62 100644
> --- a/src/acpi/tpm2/tpm2.c
> +++ b/src/acpi/tpm2/tpm2.c
> @@ -1,7 +1,7 @@
>   /*
>    * Copyright (C) 2010-2016 Canonical
>    *
> - * This program is free software; you can redistribute it and/or
> +  * This program is free software; you can redistribute it and/or
>    * modify it under the terms of the GNU General Public License
>    * as published by the Free Software Foundation; either version 2
>    * of the License, or (at your option) any later version.
> @@ -77,18 +77,6 @@ static int tpm2_test1(fwts_framework *fw)
>   			"TPM2's Start Method must be between one to eight, got 0x%" PRIx16,
>   			tpm2->start_method);
>   	}
> -	/*
> -	 * Kernel: drivers/char/tpm/tpm_crb.c checks for a zero address for
> -	 * the control area because some versions of AMI BIOS have a bug where
> -	 * this address is zero and the kernel driver aborts on this.
> -         */
> -	if (!tpm2->address_of_control_area) {
> -		passed = false;
> -		fwts_failed(fw, LOG_LEVEL_HIGH,
> -			"TPM2BadControlAreaAddress",
> -			"TPM2's Control Area Address is expected to be non-zero, got 0x%16.16" PRIx64,
> -			tpm2->address_of_control_area);
> -	}
>
>   	if (tpm2->start_method == 2 && table->length != sizeof(fwts_acpi_table_tpm2) + 4) {
>   		passed = false;
>

Looks like the kernel commit 399235dc6e95400a1322a9999e92073bc572f0c8 
removed the check of control_area.

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu April 21, 2016, 9:59 a.m. UTC | #2
On 2016年04月21日 16:30, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Turns out that a zero control area address can be zero to indicate that
> the Control Area is not required. Kudos to Alex Hung for spotting this issue.
>
> This reverts commit 897b1164b7bfd2b46259906a04190f1cba46c34b.
> ---
>   src/acpi/tpm2/tpm2.c | 14 +-------------
>   1 file changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/src/acpi/tpm2/tpm2.c b/src/acpi/tpm2/tpm2.c
> index f124b02..babbc62 100644
> --- a/src/acpi/tpm2/tpm2.c
> +++ b/src/acpi/tpm2/tpm2.c
> @@ -1,7 +1,7 @@
>   /*
>    * Copyright (C) 2010-2016 Canonical
>    *
> - * This program is free software; you can redistribute it and/or
> +  * This program is free software; you can redistribute it and/or
>    * modify it under the terms of the GNU General Public License
>    * as published by the Free Software Foundation; either version 2
>    * of the License, or (at your option) any later version.
> @@ -77,18 +77,6 @@ static int tpm2_test1(fwts_framework *fw)
>   			"TPM2's Start Method must be between one to eight, got 0x%" PRIx16,
>   			tpm2->start_method);
>   	}
> -	/*
> -	 * Kernel: drivers/char/tpm/tpm_crb.c checks for a zero address for
> -	 * the control area because some versions of AMI BIOS have a bug where
> -	 * this address is zero and the kernel driver aborts on this.
> -         */
> -	if (!tpm2->address_of_control_area) {
> -		passed = false;
> -		fwts_failed(fw, LOG_LEVEL_HIGH,
> -			"TPM2BadControlAreaAddress",
> -			"TPM2's Control Area Address is expected to be non-zero, got 0x%16.16" PRIx64,
> -			tpm2->address_of_control_area);
> -	}
>
>   	if (tpm2->start_method == 2 && table->length != sizeof(fwts_acpi_table_tpm2) + 4) {
>   		passed = false;
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox

Patch

diff --git a/src/acpi/tpm2/tpm2.c b/src/acpi/tpm2/tpm2.c
index f124b02..babbc62 100644
--- a/src/acpi/tpm2/tpm2.c
+++ b/src/acpi/tpm2/tpm2.c
@@ -1,7 +1,7 @@ 
 /*
  * Copyright (C) 2010-2016 Canonical
  *
- * This program is free software; you can redistribute it and/or
+  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  * of the License, or (at your option) any later version.
@@ -77,18 +77,6 @@  static int tpm2_test1(fwts_framework *fw)
 			"TPM2's Start Method must be between one to eight, got 0x%" PRIx16,
 			tpm2->start_method);
 	}
-	/*
-	 * Kernel: drivers/char/tpm/tpm_crb.c checks for a zero address for
-	 * the control area because some versions of AMI BIOS have a bug where
-	 * this address is zero and the kernel driver aborts on this.
-         */
-	if (!tpm2->address_of_control_area) {
-		passed = false;
-		fwts_failed(fw, LOG_LEVEL_HIGH,
-			"TPM2BadControlAreaAddress",
-			"TPM2's Control Area Address is expected to be non-zero, got 0x%16.16" PRIx64,
-			tpm2->address_of_control_area);
-	}
 
 	if (tpm2->start_method == 2 && table->length != sizeof(fwts_acpi_table_tpm2) + 4) {
 		passed = false;