ACPI/APEI: fix error status check condition for CPER
PATCH 1/1 ACPI/APEI: fix error status check condition for CPER
In Table 18-289, ACPI5.0 SPEC, the error data length in CPER Generic Error Data Entry can be 0, which means this generic error data entry can have only one header. So fix the check conditon for it.
--- drivers/acpi/apei/cper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/cper.c +1 -1
@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)return rc; data_len = estatus->data_length; gdata = (struct acpi_hest_generic_data *)(estatus +1 ); -while (data_len >sizeof (*gdata)) { +while (data_len >=sizeof (*gdata)) { gedata_len = gdata->error_data_length;if (gedata_len > data_len -sizeof (*gdata))return -EINVAL ;
Signature · 1 line
1.7.10.4
Quoted 6 lines · Chen Gong
In Table 18-289, ACPI5.0 SPEC, the error data length in CPER Generic Error Data Entry can be 0, which means this generic error data entry can have only one header. So fix the check conditon for it.
Signed-off-by Chen Gong <[email protected]>
Good catch!
Quoted 17 lines
--- drivers/acpi/apei/cper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/apei/cper.c +1
-1@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)return rc; data_len = estatus->data_length; gdata = (struct acpi_hest_generic_data *)(estatus +1 ); -while (data_len >sizeof (*gdata)) { +while (data_len >=sizeof (*gdata)) { gedata_len = gdata->error_data_length;if (gedata_len > data_len -sizeof (*gdata))return -EINVAL ;
Rafael J. Wysocki
AppliedQuoted 11 lines · Huang Ying
Quoted 6 lines · Chen Gong
In Table 18-289, ACPI5.0 SPEC, the error data length in CPER Generic Error Data Entry can be 0, which means this generic error data entry can have only one header. So fix the check conditon for it.
Signed-off-by Chen Gong <[email protected]>Good catch!
Reviewed-by Huang Ying <[email protected]>
Applied. I'm going to push it for 3.9.
Thanks,
Rafael
Quoted 23 lines
Quoted 9 lines
--- drivers/acpi/apei/cper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/acpi/apei/cper.c +0
-0drivers/acpi/apei/cper.c int apei_estatus_check(const struct acpi_hest_generic_status *estatus) · line 411
Quoted 8 lines
drivers/acpi/apei/cper.c +1
-1@@ -405,7 +405,7 @@ int apei_estatus_check(const struct acpi_hest_generic_status *estatus)return rc; data_len = estatus->data_length; gdata = (struct acpi_hest_generic_data *)(estatus +1 ); -while (data_len >sizeof (*gdata)) { +while (data_len >=sizeof (*gdata)) { gedata_len = gdata->error_data_length;if (gedata_len > data_len -sizeof (*gdata))return -EINVAL ;--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.