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 765F91C6FE1; Tue, 11 Nov 2025 01:00:00 +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=1762822800; cv=none; b=HxgLgmfsMNigEDGTpey3UD4wPfkjQF66YXghnL4EBUDK7f5YiCZD6f1eN+zUfplAO3PUQ9r+O2HLImH2tD90AeJx8E8fnzVgYw9NUEae2wo2Q9Cuf/Zhs0wiuRxzxjK6EWUnCKexr4GV2ntNoA4T8OLPx7IBvtEotjX7Y5Qe7KY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762822800; c=relaxed/simple; bh=9lPZRTmxdR2O3CUvtA+fIF/A1WoZb7J626jv7i/nFqg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DMd886ZIFyeO82jkXNY+W6vIYXg6BtTK6LXp/sB/rOErBxQZx9rI+xqGzKQFfgzhqtea/wWgi7miF7qx/sPLXKMA2XE0pt2qcbpSi9lLaIEV4WhAN90yDzx2Xs/AGPi9Ir3N38prgoVa+PCFeFoquuLhKRhb5Zm5XKkKnsA5byc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zU6sbkxN; 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="zU6sbkxN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2B13C116B1; Tue, 11 Nov 2025 00:59:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762822800; bh=9lPZRTmxdR2O3CUvtA+fIF/A1WoZb7J626jv7i/nFqg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zU6sbkxNTUJ5vdPPr1MrqlljmBJvqduSKHWu7uB0bYXUA1mx4zJWOgwkdlBz8fKqD tK4/6UMeKVtVFGF+2ZRZ1Y0kZB0+tw8dsk1sOKZ+1u2xzGalz77w2MKduiHdMFNkbP 0M6+DBmpycQ93Ie93D8BHB70eIexFiGyvDZ0a514= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Shang song (Lenovo)" , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 6.12 111/565] ACPI: PRM: Skip handlers with NULL handler_address or NULL VA Date: Tue, 11 Nov 2025 09:39:27 +0900 Message-ID: <20251111004529.453941639@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004526.816196597@linuxfoundation.org> References: <20251111004526.816196597@linuxfoundation.org> User-Agent: quilt/0.69 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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shang song (Lenovo) [ Upstream commit 311942ce763e21dacef7e53996d5a1e19b8adab1 ] If handler_address or mapped VA is NULL, the related buffer address and VA can be ignored, so make acpi_parse_prmt() skip the current handler in those cases. Signed-off-by: Shang song (Lenovo) Link: https://patch.msgid.link/20250826030229.834901-1-shangsong2@foxmail.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/prmt.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index be033bbb126a4..6792d4385eee4 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -150,15 +150,28 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) th = &tm->handlers[cur_handler]; guid_copy(&th->guid, (guid_t *)handler_info->handler_guid); + + /* + * Print an error message if handler_address is NULL, the parse of VA also + * can be skipped. + */ + if (unlikely(!handler_info->handler_address)) { + pr_info("Skipping handler with NULL address for GUID: %pUL", + (guid_t *)handler_info->handler_guid); + continue; + } + th->handler_addr = (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address); /* - * Print a warning message if handler_addr is zero which is not expected to - * ever happen. + * Print a warning message and skip the parse of VA if handler_addr is zero + * which is not expected to ever happen. */ - if (unlikely(!th->handler_addr)) + if (unlikely(!th->handler_addr)) { pr_warn("Failed to find VA of handler for GUID: %pUL, PA: 0x%llx", &th->guid, handler_info->handler_address); + continue; + } th->static_data_buffer_addr = efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address); -- 2.51.0