diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-04-28 13:45:31 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-04-28 13:45:31 -0400 |
commit | 344284eab562fa69e9c0c0f45c79d7227f5f2858 (patch) | |
tree | 05928aace65aef5390d34bb8e4752c646954c4db /drivers/firmware/efi/cper.c | |
parent | d26b2fc5c0474086af79d33554a133247e8e69c3 (diff) | |
parent | 19bb613acb9ad8e57593cad5118acaee117cc303 (diff) |
Merge tag 'v4.19.37' into v4.19-rt
This is the 4.19.37 stable release
Conflicts:
include/linux/sched/mm.h
kernel/sched/fair.c
Diffstat (limited to 'drivers/firmware/efi/cper.c')
-rw-r--r-- | drivers/firmware/efi/cper.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index a7902fccdcfa..6090d25dce85 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -546,19 +546,24 @@ EXPORT_SYMBOL_GPL(cper_estatus_check_header); int cper_estatus_check(const struct acpi_hest_generic_status *estatus) { struct acpi_hest_generic_data *gdata; - unsigned int data_len, gedata_len; + unsigned int data_len, record_size; int rc; rc = cper_estatus_check_header(estatus); if (rc) return rc; + data_len = estatus->data_length; apei_estatus_for_each_section(estatus, gdata) { - gedata_len = acpi_hest_get_error_length(gdata); - if (gedata_len > data_len - acpi_hest_get_size(gdata)) + if (sizeof(struct acpi_hest_generic_data) > data_len) + return -EINVAL; + + record_size = acpi_hest_get_record_size(gdata); + if (record_size > data_len) return -EINVAL; - data_len -= acpi_hest_get_record_size(gdata); + + data_len -= record_size; } if (data_len) return -EINVAL; |