Message ID | 20190704161541.31154-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | acpi: method: skip over bad method_handle and failed message type | expand |
On 2019-07-04 10:15 a.m., Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > When fetching the method_handle and the message type there are > issues warning about failures but no real error handling. This > can lead to an uninitialized method_handle being passed into > AcpiGetType that can cause an uninitialized pointer read. Fix > these failures by continuing on to the next method inthe list. > > Addresses-Coverity: ("Uninitialized pointer read") > Fixes: e2a21f8d75d8 ("acpi: method: skip scope names in method_evaluate_method") > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/method/method.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c > index eeb9c7fa..787e3438 100644 > --- a/src/acpi/method/method.c > +++ b/src/acpi/method/method.c > @@ -410,10 +410,12 @@ static int method_evaluate_method(fwts_framework *fw, > status = AcpiGetHandle (NULL, method_name, &method_handle); > if (ACPI_FAILURE(status)) { > fwts_warning(fw, "Failed to get handle for object %s.", name); > + continue; > } > status = AcpiGetType(method_handle, &type); > if (ACPI_FAILURE(status)) { > fwts_warning(fw, "Failed to get object type for %s.",name); > + continue; > } > > if (type == ACPI_TYPE_LOCAL_SCOPE) > Acked-by: Alex Hung <alex.hung@canonical.com>
On 7/5/19 12:15 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > When fetching the method_handle and the message type there are > issues warning about failures but no real error handling. This > can lead to an uninitialized method_handle being passed into > AcpiGetType that can cause an uninitialized pointer read. Fix > these failures by continuing on to the next method inthe list. > > Addresses-Coverity: ("Uninitialized pointer read") > Fixes: e2a21f8d75d8 ("acpi: method: skip scope names in method_evaluate_method") > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/method/method.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c > index eeb9c7fa..787e3438 100644 > --- a/src/acpi/method/method.c > +++ b/src/acpi/method/method.c > @@ -410,10 +410,12 @@ static int method_evaluate_method(fwts_framework *fw, > status = AcpiGetHandle (NULL, method_name, &method_handle); > if (ACPI_FAILURE(status)) { > fwts_warning(fw, "Failed to get handle for object %s.", name); > + continue; > } > status = AcpiGetType(method_handle, &type); > if (ACPI_FAILURE(status)) { > fwts_warning(fw, "Failed to get object type for %s.",name); > + continue; > } > > if (type == ACPI_TYPE_LOCAL_SCOPE) > Acked-by: Ivan Hu <ivan.hu@canonical.com>
On 7/5/19 12:15 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > When fetching the method_handle and the message type there are > issues warning about failures but no real error handling. This > can lead to an uninitialized method_handle being passed into > AcpiGetType that can cause an uninitialized pointer read. Fix > these failures by continuing on to the next method inthe list. > > Addresses-Coverity: ("Uninitialized pointer read") > Fixes: e2a21f8d75d8 ("acpi: method: skip scope names in method_evaluate_method") > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/method/method.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c > index eeb9c7fa..787e3438 100644 > --- a/src/acpi/method/method.c > +++ b/src/acpi/method/method.c > @@ -410,10 +410,12 @@ static int method_evaluate_method(fwts_framework *fw, > status = AcpiGetHandle (NULL, method_name, &method_handle); > if (ACPI_FAILURE(status)) { > fwts_warning(fw, "Failed to get handle for object %s.", name); > + continue; > } > status = AcpiGetType(method_handle, &type); > if (ACPI_FAILURE(status)) { > fwts_warning(fw, "Failed to get object type for %s.",name); > + continue; > } > > if (type == ACPI_TYPE_LOCAL_SCOPE) > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/acpi/method/method.c b/src/acpi/method/method.c index eeb9c7fa..787e3438 100644 --- a/src/acpi/method/method.c +++ b/src/acpi/method/method.c @@ -410,10 +410,12 @@ static int method_evaluate_method(fwts_framework *fw, status = AcpiGetHandle (NULL, method_name, &method_handle); if (ACPI_FAILURE(status)) { fwts_warning(fw, "Failed to get handle for object %s.", name); + continue; } status = AcpiGetType(method_handle, &type); if (ACPI_FAILURE(status)) { fwts_warning(fw, "Failed to get object type for %s.",name); + continue; } if (type == ACPI_TYPE_LOCAL_SCOPE)