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=1795027778; b=hg2FA5/t9tSYrbmtfk8VX+TDR6Q5crW4YqE5Y+HVjF5Ig05p+++lsiEupRsQSLafLCYB mpDegScOPQrPdBNTL3ou52LD5Tf98O+ZuEO+1uCatNsLuyu0T0QehxgwtujaUvVaHdGjf B6gpibAh1RFEINbg/FdhOYW9U9bEaCwoiyk3Qdl1QpW3oUxfJm6t71UnuSOJGiQZT2ufh RI/UbC/+xctjUFPn6ndAHeH8gotaOi8VwT6eGITmNQCDP2891X118ij8ehAaaXzbZAod/ IhPufVqGZj1hJUdBUPSptfsTciYCIXwXJfyyylR8xo2SyffrKUQQLP61LW5s9IRIW2A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795027778; 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=12BImsLDAtJphhaftw5NM81LxWDLBY+oQG36/O4RV5Q=; b=TgfaATGpKMyKWOSFTzJ6tYpvV3hBuidOG/zF4TWezC1Ba9ZJ/KPcSODYoUMhCNDOuhRe O3pY88asd+sEkE6Qpc+jB0/6IMzyV9yROwznBzv01m7akNAUECwV8Djf3SEiS7bxtU/yD LPN1mUHMBhTvsMoyeLcz+TQ087DBhT0mCVKggxt/qEUJ+FdHNFnTxs6BvtX1hH2eRpUhY MmOXQazBNtZ+UCMa4R8FO5U+dNAYGdOMmYn+yl0AH4y8807NjatxPVQ/ZxO/TXZ4yqM5Q 7LqMEb4CJpxWc8AG4k0sP+FwFKsvkkrw/wJ9yli6C4EKbqTX9hrpsSmz+Gq+m3JR2Dw== 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=R8t4FQB8; 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 BC9FF606A330; Wed, 18 Nov 2026 18:49:38 +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=R8t4FQB8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0AAA1F000C9; Wed, 18 Nov 2026 18:49:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795027778; bh=12BImsLDAtJphhaftw5NM81LxWDLBY+oQG36/O4RV5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R8t4FQB8phJauG7H/pPBFp56D6ZIY2a0nyD5razhoQyRgyz9DJcj8qq/VoS8I1s+l dhKHkN9xpbs7am2oohkv5xLjxZkayvUq/R9yi0HwezJro2BBYwocVcOR//e8JNP3QO X1rMbUaHt14Ly/kbxkVOGKpTWEofZ3BvwJkeFBPY= 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.18 1908/2151] ACPICA: Initialize parser_state.aml_end in acpi_install_method() Date: Wed, 18 Nov 2026 16:00:43 +0100 Message-ID: <20261118150231.293218242@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@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.18-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 821fb4930e9d8..7969e4aa90763 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