public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Bob Moore <robert.moore@intel.com>
Subject: [PATCH 03/11] ACPICA: Check that EBDA pointer is in valid memory
Date: Thu, 27 Oct 2022 19:50:06 +0200	[thread overview]
Message-ID: <10171725.nUPlyArG6x@kreacher> (raw)
In-Reply-To: <4756726.GXAFRqVoOG@kreacher>

From: Vit Kabele <vit@kabele.me>

ACPICA commit cc9e7763ceb2e2649fe3422130416d84a3c6854a

If the memory at 0x40e is uninitialized, the retrieved physical_memory
address of EBDA may be beyond the low memory (i.e. above 640K).

If so, the kernel may unintentionally access the VGA memory, that
might not be decoded or even present in case of virtualization.

Link: https://github.com/acpica/acpica/commit/cc9e7763
Signed-off-by: Vit Kabele <vit@kabele.me>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpica/tbxfroot.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: linux-pm/drivers/acpi/acpica/tbxfroot.c
===================================================================
--- linux-pm.orig/drivers/acpi/acpica/tbxfroot.c
+++ linux-pm/drivers/acpi/acpica/tbxfroot.c
@@ -139,7 +139,11 @@ acpi_find_root_pointer(acpi_physical_add
 
 	/* EBDA present? */
 
-	if (physical_address > 0x400) {
+	/*
+	 * Check that the EBDA pointer from memory is sane and does not point
+	 * above valid low memory
+	 */
+	if (physical_address > 0x400 && physical_address < 0xA0000) {
 		/*
 		 * 1b) Search EBDA paragraphs (EBDA is required to be a
 		 *     minimum of 1K length)




  parent reply	other threads:[~2022-10-27 18:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 17:45 [PATCH 00/11] ACPICA: Upstream changes since ACPICA 20220331 Rafael J. Wysocki
2022-10-27 17:47 ` [PATCH 01/11] ACPICA: MADT: Add loong_arch-specific APICs support Rafael J. Wysocki
2022-10-27 17:48 ` [PATCH 02/11] ACPICA: Events: Support fixed PCIe wake event Rafael J. Wysocki
2022-10-27 17:50 ` Rafael J. Wysocki [this message]
2022-10-27 17:50 ` [PATCH 04/11] ACPICA: Do not touch VGA memory when EBDA < 1ki_b Rafael J. Wysocki
2022-10-27 17:51 ` [PATCH 05/11] ACPICA: iASL: Add CCEL table to both compiler/disassembler Rafael J. Wysocki
2022-10-27 17:52 ` [PATCH 06/11] ACPICA: Add a couple of new UUIDs to the known UUID list Rafael J. Wysocki
2022-10-27 17:54 ` [PATCH 07/11] ACPICA: Add support for FFH Opregion special context data Rafael J. Wysocki
2022-10-27 17:55 ` [PATCH 08/11] ACPICA: Improve warning message for "invalid ACPI name" Rafael J. Wysocki
2022-10-27 17:56 ` [PATCH 09/11] ACPICA: Add CXL 3.0 structures (CXIMS & RDPAS) to the CEDT table Rafael J. Wysocki
2022-10-27 17:57 ` [PATCH 10/11] ACPICA: IORT: Update for revision E.e Rafael J. Wysocki
2022-10-27 17:58 ` [PATCH 11/11] ACPICA: Finish support for the CDAT table Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10171725.nUPlyArG6x@kreacher \
    --to=rjw@rjwysocki.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robert.moore@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox