ACK: [PATCH] acpi: acpidump: fix segfault on BERT entries (LP: #1206643)
Alex Hung
alex.hung at canonical.com
Thu Aug 1 07:55:59 UTC 2013
On 07/31/2013 02:58 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The BERT is incorreclty configured in the fwts acpidump so we fall
> off the end and segfault. Fix the table definition and dump just the
> fields as specified in the ACPI spec. I must have been on the plane
> writing the original code.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/acpidump/acpidump.c | 17 -----------------
> src/lib/include/fwts_acpi.h | 6 ------
> 2 files changed, 23 deletions(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index 51132f5..c592926 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -375,31 +375,14 @@ static void acpidump_bert(fwts_framework *fw, fwts_acpi_table_info *table)
> {
> uint8_t *data = (uint8_t *)table->data;
> size_t length = table->length;
> - fwts_acpi_table_bert *bert = (fwts_acpi_table_bert*)data;
> -
> - static char *error_severity[] = {
> - "Correctable",
> - "Fatal",
> - "Corrected",
> - "None"
> - };
> -
> - int n = length - sizeof(fwts_acpi_table_bert);
>
> static fwts_acpidump_field fields[] = {
> FIELD_UINT("Region Length", fwts_acpi_table_bert, boot_error_region_length),
> FIELD_UINT("Region Addr", fwts_acpi_table_bert, boot_error_region),
> - FIELD_UINT("Boot Status", fwts_acpi_table_bert, boot_status),
> - FIELD_UINT("Raw Data Offset", fwts_acpi_table_bert, raw_data_offset),
> - FIELD_UINT("Raw Data Length", fwts_acpi_table_bert, raw_data_length),
> - FIELD_UINT("Error Severity", fwts_acpi_table_bert, error_severity),
> - FIELD_STRS("Generic Error Data",fwts_acpi_table_bert, generic_error_data, error_severity, 4),
> FIELD_END
> };
>
> acpi_dump_table_fields(fw, data, fields, length, length);
> - fwts_log_nl(fw);
> - acpi_dump_raw_data(fw, bert->generic_error_data, n, sizeof(fwts_acpi_table_bert));
> }
>
> static void acpidump_cpep(fwts_framework *fw, fwts_acpi_table_info *table)
> diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
> index 4a62ec4..fc974b2 100644
> --- a/src/lib/include/fwts_acpi.h
> +++ b/src/lib/include/fwts_acpi.h
> @@ -78,12 +78,6 @@ typedef struct {
> fwts_acpi_table_header header;
> uint32_t boot_error_region_length;
> uint64_t boot_error_region;
> - uint32_t boot_status;
> - uint32_t raw_data_offset;
> - uint32_t raw_data_length;
> - uint32_t data_length;
> - uint32_t error_severity;
> - uint8_t generic_error_data[0];
> } __attribute__ ((packed)) fwts_acpi_table_bert;
>
> typedef struct {
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list