Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp629451pxb; Tue, 5 Apr 2022 16:32:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaokaY6aJWm+dclj4HDXELNpyMr8LQ0snPRGIA4u5hgFIQ79GwGQNy1d2n91rvQzrEzqyz X-Received: by 2002:a05:6a00:1828:b0:4fd:e0e5:6115 with SMTP id y40-20020a056a00182800b004fde0e56115mr6055525pfa.52.1649201543746; Tue, 05 Apr 2022 16:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649201543; cv=none; d=google.com; s=arc-20160816; b=Th1PAiupvg8bCAjI5QXKSgItweaIwanG77QVFwwO2H/iRfNxbNZgY1eveKxMSfYFU0 3svshpQdSW76vB4d1oMMx4n2hUHjJWv2TgVRXO0D2no+2vEskhuyoqf3X4pEDb7p1GSd oJUJ0WLZLzVr8Hk2CrlGtx+xrYuoZWlYWafvLAFnXIiDv2mXSnpPB6BV9bo5nZ07gDB4 CDi1hRAvcVMNFy9+dafqC1wywIpalobpc0dxSXCnWUrr4y/wpwcsiBGVJQmSNX7tfVHj ZRmpQd/B8bq0sbRYfkhcTEMYLDVNh0l3pE0W3nikV6nwK+2JD0FmIC183RPDEvXno8Ku 2JIA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mH2DusimCeJvg1UhEpdB9+MXWNLQ74XiniFf4Z0nLbo=; b=q7mZOCfaNa34Oz3FA79OconXCnmKnYVen19L3gN9JH1dBe7Z5w91LdFSEj1dkwrKD3 kWuVU/CeQS1AbJy3003J0X9wd/WEQGVISknW+8+YaWqXxeicXrwrOt9QR73glIFOaz7O G1FD7TmkKS1x/lAn1sG130UD3/HINTfp+Sw0QhHfo40DVZ0/taj0BKZSDicOkc8/3Vl1 sRe8nnQ2oHqnaorgChjQOLXjiXCFHd+Qg4ESbzPJ44XVINzV6ertk2VPqa9PM3D6kl8O Tk6beyEWTplh79iRy6w+dEJ0UqocfBaXiQ3zLnieqpHn/S/6/neZfO7xsjjUz3Aes3UU Q/SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wgxgDKDO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l6-20020a170903244600b00153bc4c09b5si14749688pls.265.2022.04.05.16.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 16:32:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wgxgDKDO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2780BE9EA; Tue, 5 Apr 2022 16:16:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387725AbiDENP3 (ORCPT + 99 others); Tue, 5 Apr 2022 09:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344270AbiDEJTD (ORCPT ); Tue, 5 Apr 2022 05:19:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7972B22528; Tue, 5 Apr 2022 02:06:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 18A7A614E4; Tue, 5 Apr 2022 09:06:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2194AC385A0; Tue, 5 Apr 2022 09:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649149602; bh=0koZQSOLgRW2kaRazCNUDwDk9THdGrokMdcTAp4Ow68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wgxgDKDORwuAkQtHyFBYhn638HBorMGuPeFuWtcVYtMHCxCR706hfMfJ39UYrer46 iyFBen7oeaWlpmRW5nZ+S7LmVz5pTQ/fVkFn8ajjstJDNq0NVfCf4M744NDbqUVCZ0 7CHijFQc3qiBLzOWMH2Q2T6p6h3TUVsydKlrhHlU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 5.16 0774/1017] ACPICA: Avoid walking the ACPI Namespace if it is not there Date: Tue, 5 Apr 2022 09:28:07 +0200 Message-Id: <20220405070417.234521252@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070354.155796697@linuxfoundation.org> References: <20220405070354.155796697@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki [ Upstream commit 0c9992315e738e7d6e927ef36839a466b080dba6 ] ACPICA commit b1c3656ef4950098e530be68d4b589584f06cddc Prevent acpi_ns_walk_namespace() from crashing when called with start_node equal to ACPI_ROOT_OBJECT if the Namespace has not been instantiated yet and acpi_gbl_root_node is NULL. For instance, this can happen if the kernel is run with "acpi=off" in the command line. Link: https://github.com/acpica/acpica/commit/b1c3656ef4950098e530be68d4b589584f06cddc Link: https://lore.kernel.org/linux-acpi/CAJZ5v0hJWW_vZ3wwajE7xT38aWjY7cZyvqMJpXHzUL98-SiCVQ@mail.gmail.com/ Reported-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/nswalk.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c index 915c2433463d..e7c30ce06e18 100644 --- a/drivers/acpi/acpica/nswalk.c +++ b/drivers/acpi/acpica/nswalk.c @@ -169,6 +169,9 @@ acpi_ns_walk_namespace(acpi_object_type type, if (start_node == ACPI_ROOT_OBJECT) { start_node = acpi_gbl_root_node; + if (!start_node) { + return_ACPI_STATUS(AE_NO_NAMESPACE); + } } /* Null child means "get first node" */ -- 2.34.1