From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA8202EBDD6; Tue, 15 Jul 2025 13:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587689; cv=none; b=dbPFd6ZhMsRnEbM0CDrS8ik7QLY9P2WiG8JoDJSPHeEuEFPQAP+clkOgzywm6feNDYBhAILgn+i56rhK1kjpUgPpVTQeODCVL1TsU3IkmWuOa+zxM559cCuFuQUN9OuJyK1KCjvw9VkyTCEuBHTubJl+FkrKW7uX1gvM0ShpTa4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587689; c=relaxed/simple; bh=6Y43NZfOWeruadxtjL7pResRROJjEuxArBHPX23nOeY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OKX8j1za2TCsF1VPDn7DeDM2fqS3Og2Qtm2bXWscJMzHhtJZfC+QY/ilhtuaaKuE15d8ikybVX1C0yDIF4eX7Gl+FGsf2Il9UGRWE3Rkzo8p2D7kPeJbI20EjPMSAtFlWzvOowfcN/y/8Stv0CYbgolzHKs7vbWQ3psGwcF+jUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PIq92HWn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PIq92HWn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6CE8DC4CEE3; Tue, 15 Jul 2025 13:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752587689; bh=6Y43NZfOWeruadxtjL7pResRROJjEuxArBHPX23nOeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PIq92HWnH7a9Y7RPNJNpi6i++dkfanUN+xj4ndRid1PHCZUDO71CjWQu+MMCZRx+Z 5yWUji5QRshJBAabunjsXXjdaaT34uX7qZ2I0Cc6kzNw2WlLmP3HfhVwKiPTYcDVQW ygVGB/3wjofNxOjV9R2K5+UPaYcKjdc+U5FxqqwA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Peter Williams , "Rafael J. Wysocki" , Hans de Goede , Sasha Levin Subject: [PATCH 5.10 107/208] ACPICA: Refuse to evaluate a method if arguments are missing Date: Tue, 15 Jul 2025 15:13:36 +0200 Message-ID: <20250715130815.233717562@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250715130810.830580412@linuxfoundation.org> References: <20250715130810.830580412@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rafael J. Wysocki [ Upstream commit 6fcab2791543924d438e7fa49276d0998b0a069f ] As reported in [1], a platform firmware update that increased the number of method parameters and forgot to update a least one of its callers, caused ACPICA to crash due to use-after-free. Since this a result of a clear AML issue that arguably cannot be fixed up by the interpreter (it cannot produce missing data out of thin air), address it by making ACPICA refuse to evaluate a method if the caller attempts to pass fewer arguments than expected to it. Closes: https://github.com/acpica/acpica/issues/1027 [1] Reported-by: Peter Williams Signed-off-by: Rafael J. Wysocki Reviewed-by: Hans de Goede Tested-by: Hans de Goede # Dell XPS 9640 with BIOS 1.12.0 Link: https://patch.msgid.link/5909446.DvuYhMxLoT@rjwysocki.net Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/acpica/dsmethod.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c index 97971c79c5f56..13c67f58e9052 100644 --- a/drivers/acpi/acpica/dsmethod.c +++ b/drivers/acpi/acpica/dsmethod.c @@ -483,6 +483,13 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, return_ACPI_STATUS(AE_NULL_OBJECT); } + if (this_walk_state->num_operands < obj_desc->method.param_count) { + ACPI_ERROR((AE_INFO, "Missing argument for method [%4.4s]", + acpi_ut_get_node_name(method_node))); + + return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG); + } + /* Init for new method, possibly wait on method mutex */ status = -- 2.39.5