From: "tip-bot2 for Steven Clarkson" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Steven Clarkson <sc@lambdal.com>, Borislav Petkov <bp@suse.de>,
linux-acpi@vger.kernel.org, x86 <x86@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [tip: x86/urgent] x86/boot: Handle malformed SRAT tables during early ACPI parsing
Date: Fri, 31 Jan 2020 19:10:28 -0000 [thread overview]
Message-ID: <158049782801.396.10779532409008194964.tip-bot2@tip-bot2> (raw)
In-Reply-To: <CAHKq8taGzj0u1E_i=poHUam60Bko5BpiJ9jn0fAupFUYexvdUQ@mail.gmail.com>
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 2b73ea3796242608b4ccf019ff217156c92e92fe
Gitweb: https://git.kernel.org/tip/2b73ea3796242608b4ccf019ff217156c92e92fe
Author: Steven Clarkson <sc@lambdal.com>
AuthorDate: Thu, 30 Jan 2020 16:48:16 -08:00
Committer: Borislav Petkov <bp@suse.de>
CommitterDate: Fri, 31 Jan 2020 20:03:23 +01:00
x86/boot: Handle malformed SRAT tables during early ACPI parsing
Break an infinite loop when early parsing of the SRAT table is caused
by a subtable with zero length. Known to affect the ASUS WS X299 SAGE
motherboard with firmware version 1201 which has a large block of
zeros in its SRAT table. The kernel could boot successfully on this
board/firmware prior to the introduction of early parsing this table or
after a BIOS update.
[ bp: Fixup whitespace damage and commit message. Make it return 0 to
denote that there are no immovable regions because who knows what
else is broken in this BIOS. ]
Fixes: 02a3e3cdb7f1 ("x86/boot: Parse SRAT table and count immovable memory regions")
Signed-off-by: Steven Clarkson <sc@lambdal.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: linux-acpi@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206343
Link: https://lkml.kernel.org/r/CAHKq8taGzj0u1E_i=poHUam60Bko5BpiJ9jn0fAupFUYexvdUQ@mail.gmail.com
---
arch/x86/boot/compressed/acpi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/boot/compressed/acpi.c b/arch/x86/boot/compressed/acpi.c
index 25019d4..ef2ad72 100644
--- a/arch/x86/boot/compressed/acpi.c
+++ b/arch/x86/boot/compressed/acpi.c
@@ -393,7 +393,13 @@ int count_immovable_mem_regions(void)
table = table_addr + sizeof(struct acpi_table_srat);
while (table + sizeof(struct acpi_subtable_header) < table_end) {
+
sub_table = (struct acpi_subtable_header *)table;
+ if (!sub_table->length) {
+ debug_putstr("Invalid zero length SRAT subtable.\n");
+ return 0;
+ }
+
if (sub_table->type == ACPI_SRAT_TYPE_MEMORY_AFFINITY) {
struct acpi_srat_mem_affinity *ma;
prev parent reply other threads:[~2020-01-31 19:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-31 0:48 [PATCH] " Steven Clarkson
2020-01-31 18:55 ` Borislav Petkov
2020-01-31 23:00 ` Steven Clarkson
2020-01-31 23:02 ` Borislav Petkov
2020-01-31 18:58 ` [tip: x86/urgent] " tip-bot2 for Steven Clarkson
2020-01-31 19:10 ` tip-bot2 for Steven Clarkson [this message]
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=158049782801.396.10779532409008194964.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@suse.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=sc@lambdal.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®