[30/32] ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
Message ID | 3219383.AJdgDx1Vlc@kreacher |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp345710vqo; Wed, 5 Apr 2023 07:22:03 -0700 (PDT) X-Google-Smtp-Source: AKy350ZI3RuCPyDNF0mkEB9c1fWwLXxsUHnxtNYHycPXlGVjZuK2EeiF0EQ1GIcfQ9QgCvJ9jRE5 X-Received: by 2002:a17:902:cec5:b0:19c:bcb1:d8c3 with SMTP id d5-20020a170902cec500b0019cbcb1d8c3mr7546636plg.54.1680704523417; Wed, 05 Apr 2023 07:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680704523; cv=none; d=google.com; s=arc-20160816; b=pR/Z5J5BlzwXBbj3SwnN1r9BWY+KQgjhgUWqIT86VxsWR0sbC5zC6R6VGb7ZcoOjaK NSo5Uk/qE8oaVe9vIybiBWZVNzkduF8Jb2k/86oAEdAnIi4G2bBcPplDnzlcMm5HNpON 4ISwojJ5X9S0owZ0T9Wuw9HwAI+TDi+v/E0coEpdcS/uLPgUdere/5IB/3hBi7SZMkVV VCZGA1pOsKnOApYaoA0XMw7Vd3NLKDjjviUop7inat87Zet6uruRQJ7W2hvznsmvnK/g Nw+Rq1RfrnJR9lyU0SngTechnuVQb1H+QJTUqWsnxLxGsWg5brFVuVuyVo8O/25Bxbfu hEKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=A9j4Dy4j5hqa3xtUvECBaY59L/Bdcpss3s4DZ+YqOa4=; b=gE2DAwwFH/HEsWT9FDfpfu2TIdAAUUqihub2EKir2+zR8on4AY5AeDF01Hu76U9B1I 1Dx/7TXk8EdzBv6t3BuICaOMNpA94JykuvnNFJyvSVYLb3A/slw094Ki0hNPD87KpoYT 0YhUtNIBxFHXLgnwIriQ2Go71YDdJHqj8toaizzbKMYar0nmwR6ahpsxHt4KLfACpjxv 8rPtSB5NnIh/7W0TmWRvDDEkKaBFF77QGzfyEy1rZBP+aJ2sOu2C+gX1huTLabwMrsfO 9X7qI9XOA76EGWmiztGTX+m1iRmCKIJN19FdO/sPkVu9oyDq83L1itfUWiCLHg3q5jHE aRSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a170902864700b001a046724ae4si11936260plt.238.2023.04.05.07.21.49; Wed, 05 Apr 2023 07:22:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238037AbjDEOAs (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Wed, 5 Apr 2023 10:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238144AbjDEOAm (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Apr 2023 10:00:42 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7188613E; Wed, 5 Apr 2023 07:00:41 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.1.0) id dcf2d61551abffaa; Wed, 5 Apr 2023 16:00:39 +0200 Received: from kreacher.localnet (unknown [213.134.163.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by v370.home.net.pl (Postfix) with ESMTPSA id 42FEE1B4EA57; Wed, 5 Apr 2023 16:00:39 +0200 (CEST) From: "Rafael J. Wysocki" <rjw@rjwysocki.net> To: Linux ACPI <linux-acpi@vger.kernel.org> Cc: LKML <linux-kernel@vger.kernel.org>, Bob Moore <robert.moore@intel.com> Subject: [PATCH 30/32] ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects Date: Wed, 05 Apr 2023 15:57:57 +0200 Message-ID: <3219383.AJdgDx1Vlc@kreacher> In-Reply-To: <4845957.31r3eYUQgx@kreacher> References: <4845957.31r3eYUQgx@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.163.219 X-CLIENT-HOSTNAME: 213.134.163.219 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdejuddgjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecujffqoffgrffnpdggtffipffknecuuegrihhlohhuthemucduhedtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttdejnecuhfhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqnecuggftrfgrthhtvghrnhepledtieekkeekveeikeetgffgteeuteefjeevjeegudelvdduheeiuedvieehieevnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepvddufedrudefgedrudeifedrvdduleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrdduieefrddvudelpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeefpdhrtghpthhtoheplhhinhhugidqrggtphhisehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhosggvrhhtrdhmohhorhgvsehinhhtvghlrdgtohhm X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762346426639733125?= X-GMAIL-MSGID: =?utf-8?q?1762346426639733125?= |
Series |
ACPICA: ACPICA 20230331
|
|
Commit Message
Rafael J. Wysocki
April 5, 2023, 1:57 p.m. UTC
From: void0red <30990023+void0red@users.noreply.github.com> ACPICA commit 0d5f467d6a0ba852ea3aad68663cbcbd43300fd4 ACPI_ALLOCATE_ZEROED may fails, object_info might be null and will cause null pointer dereference later. Link: https://github.com/acpica/acpica/commit/0d5f467d Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> --- drivers/acpi/acpica/dbnames.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/acpi/acpica/dbnames.c b/drivers/acpi/acpica/dbnames.c index 3615e1a6efd8..b91155ea9c34 100644 --- a/drivers/acpi/acpica/dbnames.c +++ b/drivers/acpi/acpica/dbnames.c @@ -652,6 +652,9 @@ acpi_status acpi_db_display_objects(char *obj_type_arg, char *display_count_arg) object_info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_object_info)); + if (!object_info) + return (AE_NO_MEMORY); + /* Walk the namespace from the root */ (void)acpi_walk_namespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT,