diff mbox

acpi: rsdp: make OEM ID test less strict

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

Commit Message

Colin Ian King Aug. 25, 2015, 4:29 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The coreboot folk have noted that the OEM ID test is too strict
and perhaps isprint() should be used instead to check for bad OEM ID
strings as this makes more sense and allows spaces and other printable
characters.

Reported-by: Patrick Georgi <patrick@georgi-clan.de>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/rsdp/rsdp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Alex Hung Aug. 26, 2015, 2:10 p.m. UTC | #1
On 08/26/2015 12:29 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The coreboot folk have noted that the OEM ID test is too strict
> and perhaps isprint() should be used instead to check for bad OEM ID
> strings as this makes more sense and allows spaces and other printable
> characters.
> 
> Reported-by: Patrick Georgi <patrick@georgi-clan.de>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/rsdp/rsdp.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c
> index 2fe530b..ce5137f 100644
> --- a/src/acpi/rsdp/rsdp.c
> +++ b/src/acpi/rsdp/rsdp.c
> @@ -52,16 +52,16 @@ static int rsdp_test1(fwts_framework *fw)
>  	size_t i;
>  
>  	for (i = 0; i < 6; i++) {
> -		if (!isalnum(rsdp->oem_id[i])) {
> +		if (!isprint(rsdp->oem_id[i])) {
>  			passed = false;
>  			break;
>  		}
>  	}
>  	if (!passed) {
> -		fwts_failed(fw, LOG_LEVEL_MEDIUM,
> +		fwts_failed(fw, LOG_LEVEL_LOW,
>  			"RSDPBadOEMId",
> -			"RSDP: oem_id does not contain any alpha "
> -			"numeric characters.");
> +			"RSDP: oem_id contains non-printable "
> +			"characters.");
>  		fwts_advice(fw,
>  			"The RSDP OEM Id is non-conforming, but this "
>  			"will not affect the system behaviour. However "
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Sept. 2, 2015, 9:20 a.m. UTC | #2
On 2015年08月26日 00:29, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The coreboot folk have noted that the OEM ID test is too strict
> and perhaps isprint() should be used instead to check for bad OEM ID
> strings as this makes more sense and allows spaces and other printable
> characters.
>
> Reported-by: Patrick Georgi <patrick@georgi-clan.de>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/rsdp/rsdp.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c
> index 2fe530b..ce5137f 100644
> --- a/src/acpi/rsdp/rsdp.c
> +++ b/src/acpi/rsdp/rsdp.c
> @@ -52,16 +52,16 @@ static int rsdp_test1(fwts_framework *fw)
>   	size_t i;
>   
>   	for (i = 0; i < 6; i++) {
> -		if (!isalnum(rsdp->oem_id[i])) {
> +		if (!isprint(rsdp->oem_id[i])) {
>   			passed = false;
>   			break;
>   		}
>   	}
>   	if (!passed) {
> -		fwts_failed(fw, LOG_LEVEL_MEDIUM,
> +		fwts_failed(fw, LOG_LEVEL_LOW,
>   			"RSDPBadOEMId",
> -			"RSDP: oem_id does not contain any alpha "
> -			"numeric characters.");
> +			"RSDP: oem_id contains non-printable "
> +			"characters.");
>   		fwts_advice(fw,
>   			"The RSDP OEM Id is non-conforming, but this "
>   			"will not affect the system behaviour. However "

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

Patch

diff --git a/src/acpi/rsdp/rsdp.c b/src/acpi/rsdp/rsdp.c
index 2fe530b..ce5137f 100644
--- a/src/acpi/rsdp/rsdp.c
+++ b/src/acpi/rsdp/rsdp.c
@@ -52,16 +52,16 @@  static int rsdp_test1(fwts_framework *fw)
 	size_t i;
 
 	for (i = 0; i < 6; i++) {
-		if (!isalnum(rsdp->oem_id[i])) {
+		if (!isprint(rsdp->oem_id[i])) {
 			passed = false;
 			break;
 		}
 	}
 	if (!passed) {
-		fwts_failed(fw, LOG_LEVEL_MEDIUM,
+		fwts_failed(fw, LOG_LEVEL_LOW,
 			"RSDPBadOEMId",
-			"RSDP: oem_id does not contain any alpha "
-			"numeric characters.");
+			"RSDP: oem_id contains non-printable "
+			"characters.");
 		fwts_advice(fw,
 			"The RSDP OEM Id is non-conforming, but this "
 			"will not affect the system behaviour. However "