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 CA5F82367CE; Tue, 8 Jul 2025 16:29:46 +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=1751992186; cv=none; b=sG4Xr5JL0O1LJfN1+5IEVSY3BbT/LZJwfx+rF7oJV2HTBvxRhf9lOfKHiVG7lZwytnUve67Yv9YEFp2bfpR0C05+DTLb2aQdbrhQTnZ0DA5siEm988BValCQIrwXWrcH54VrPW/m/Hl6jbvJjZrCcpXgSTTDLuOxvfWymSIkq28= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751992186; c=relaxed/simple; bh=s8qSh/830HIAhqMz19iVxKH5/ity2Befo82yX1y2NvY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ThD3dBukAcqXSEJHbOpzo4an31q3l1kep3Dn8MvcWBwb/N5/6zyGpFEoKk4X4yER7YZc3aD9gPeiokA0/GalwEg9q9Q+9MLcrkM/JB4IG8GuWeHrYhMnIw8xRbF3OQCpYR4J4R253rSdP2k91Dz9eSZ3mdcfxly7bxBe9dX+Bsg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TiGSkmCy; 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="TiGSkmCy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 040ECC4CEF5; Tue, 8 Jul 2025 16:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751992186; bh=s8qSh/830HIAhqMz19iVxKH5/ity2Befo82yX1y2NvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TiGSkmCyO2utxR2tyfXCdCzkTmhVCYwot6WuJe1HDKIhOnz/zIamtBZYZyXDgBeTh tYwL6m7gvGGoLvGmRqGDJyWU0lg8PUY9Vqzgwth9ONPPMJjny1pQMQEA6oR3njN5R/ d1bd5vsQxPgc4Rc6OkqTKErJjriquUL9nm2PGF7I= 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 6.1 56/81] ACPICA: Refuse to evaluate a method if arguments are missing Date: Tue, 8 Jul 2025 18:23:48 +0200 Message-ID: <20250708162226.777093814@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250708162224.795155912@linuxfoundation.org> References: <20250708162224.795155912@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 9332bc688713c..05fd1ec8de14e 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