Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795050414; b=f3yley/07yWQAgP2WmQIQO6IGeRTK5K7lQx4CQZswN8Aw4eeFSVIJXAFMU0eJNKClYpl bc1Kag7NQF6v7WaygMz6lhkm9EdenxUN/28PwGUW2iF6aNJNhvP7afrgFxfBu0FBMIyej TYYm/WhviZZK0j3bgx4AvCbNa+7UApa1NUwp76njQtWX7nDER0LLu9Lp09Epy8jHRtS6t QxliLs2yNG9aWIOv4jsuhM3cqQQBK7l4WcY5nQ0yDhWm+Inz/zjpp+8HomYdw8uGIyHRU qvGpRJPMkD4n/ztnxoyPIXdTsg8SmxGF6hJ76WlWb/RdLhuP7pJxwQ0c4p3L6qehtJw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795050414; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=PucCNPLJt8D3qHbvvUw5FDOHRTmfxoIw1DVcOhHAXGU=; b=TQcDhuBscyNGSWW5UXVAx/GVl4vc1rVfqAVoprprIV2B6fiI6gfRH1JjO2P42Dcua168 lEmYNlGdoyHErppO0tn3XOZIOGl2/eJ/fnl2xkyiFVPo4pBpSI9DWSaMmXiTOcGI33r5o bB07mI1i9xGTSO3B5+LP4W3QWKzaZNiKZ3VvGalo+YekB7G7jOWrR46b0kqeK7S3Ygf4y LcTz/pCPXjg2/YvrCAFrOgBz6oY/tSY3q6SjYoJIQnZGG9v4S1tcQ2zauOpwHWiNaFxZX xB7Z34ovCAV6q/OOcvgpZ6CghrXLAVShGJeqxllRl3wOtxDynMVIFijPidg8jFNcepg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=lMdbUm9Z; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65617606A320; Thu, 19 Nov 2026 01:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=lMdbUm9Z Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6FF21F000C4; Thu, 19 Nov 2026 01:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795050414; bh=PucCNPLJt8D3qHbvvUw5FDOHRTmfxoIw1DVcOhHAXGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=lMdbUm9ZJP0K30/mGrL+WtygBp8OlsDvm+idZe+4y9pZJ2xSdnyOxIXXU7RbdUyel fs8SFG6eSMAxb8HKh8IgQjHPG5RXN9iGsVAvBEbH4WkYE8vEKydT1Vlh9ocXKPWrRx +16c4GoZ0D72FFw3JpfDtbN7ToPQrxg00g3da9nY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ivan Hu , Maciej Wieczor-Retman , Leonard Lausen , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.1 2698/2857] ACPICA: Initialize parser_state.aml_end in acpi_install_method() Date: Wed, 18 Nov 2026 16:02:12 +0100 Message-ID: <20261118150338.709476320@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ivan Hu [ Upstream commit ec696f34774db985841bac9a2df179c0040ef073 ] In AcpiInstallMethod(), the local ParserState is stack-allocated and only ParserState.Aml was initialized. Parser helpers called by this path read ParserState.AmlEnd for bounds checking: AcpiPsPeekOpcode() reads it before validating the first AML opcode, and AcpiPsGetNextPackageEnd() reads it indirectly via AcpiPsGetNextPackageLength(). The subsequent package-limit check also compares against ParserState.AmlEnd. Because AmlEnd was never set, these checks operated on an uninitialized value, which Coverity flagged as an uninitialized read (CID 1684785) and which could lead to incorrect parser bounds decisions. Coverity report: *** CID 1684785: Memory - illegal accesses (UNINIT) /src/acpica/source/components/namespace/nsxfname.c: 712 in AcpiInstallMethod() ParserState.Aml += AcpiPsGetOpcodeSize (Opcode); >>> CID 1684785: Memory - illegal accesses (UNINIT) >>> Using uninitialized value "ParserState.AmlEnd" when calling "AcpiPsGetNextPackageEnd". ParserState.PkgEnd = AcpiPsGetNextPackageEnd (&ParserState); Initialize ParserState.AmlEnd to the end of the table (Buffer + Table->Length) so the parser bounds checks operate on a valid limit. Link: https://github.com/open-acpica/acpica/commit/19429ef91ebfb2144c918038dce13e297b4ef051 Fixes: bdc357540129 ("ACPICA: add boundary checks in two places") Signed-off-by: Ivan Hu Signed-off-by: Maciej Wieczor-Retman Signed-off-by: Leonard Lausen [ rjw: Subject tweaks ] Link: https://patch.msgid.link/20261019145421.47181-2-leonard@lausen.nl Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/nsxfname.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c index 8079364e2440e..d4ebb93ce03c3 100644 --- a/drivers/acpi/acpica/nsxfname.c +++ b/drivers/acpi/acpica/nsxfname.c @@ -503,6 +503,7 @@ acpi_status acpi_install_method(u8 *buffer) /* First AML opcode in the table must be a control method */ parser_state.aml = buffer + sizeof(struct acpi_table_header); + parser_state.aml_end = buffer + table->length; opcode = acpi_ps_peek_opcode(&parser_state); if (opcode != AML_METHOD_OP) { return (AE_BAD_PARAMETER); -- 2.53.0