From patchwork Thu Jul 4 16:15:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1127625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45fjkp5F9Yz9sBp; Fri, 5 Jul 2019 02:15:46 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1hj4Od-00061I-7u; Thu, 04 Jul 2019 16:15:43 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1hj4Oc-00061C-49 for fwts-devel@lists.ubuntu.com; Thu, 04 Jul 2019 16:15:42 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hj4Ob-0006az-NB; Thu, 04 Jul 2019 16:15:41 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpi: method: skip over bad method_handle and failed message type Date: Thu, 4 Jul 2019 17:15:41 +0100 Message-Id: <20190704161541.31154-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King 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 Acked-by: Alex Hung Acked-by: Ivan Hu Acked-by: Ivan Hu --- 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)