linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dou Liyang <douly.fnst@cn.fujitsu.com>
To: <tglx@linutronix.de>, <yinghai@kernel.org>, <mingo@kernel.org>,
	<hpa@zytor.com>
Cc: <linux-tip-commits@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <x86@kernel.org>,
	<douly.fnst@cn.fujitsu.com>
Subject: [PATCH 1/2] x86/acpi: Fix the local APIC id validation in case of 0xff
Date: Sat, 8 Oct 2016 15:44:36 +0800	[thread overview]
Message-ID: <1475912677-19190-2-git-send-email-douly.fnst@cn.fujitsu.com> (raw)
In-Reply-To: <1475912677-19190-1-git-send-email-douly.fnst@cn.fujitsu.com>

In MADT, the 0xff is an invalid local APIC id.

When the kernel uses both the local APIC id and x2apic id, it may
affect x2apic.

Only add validation when the kernel parse the local APIC ids.

Reported-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
---
 arch/x86/kernel/acpi/boot.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 32a7d70..d642c95 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -233,6 +233,10 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end)
 
 	acpi_table_print_madt_entry(header);
 
+	/* the 0xff is an invalid local APIC id */
+	if (processor->id == 0xff)
+		return -EINVAL;
+
 	/*
 	 * We need to register disabled CPU as well to permit
 	 * counting disabled CPUs. This allows us to size
-- 
2.5.5

  reply	other threads:[~2016-10-08  7:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-08  7:44 [PATCH 0/2] Fix the local APIC id validation in case of 0xff Dou Liyang
2016-10-08  7:44 ` Dou Liyang [this message]
2016-10-08  7:44 ` [PATCH 2/2] x86/acpi: Fix error handling steps in parsing the lapic/x2apic entry Dou Liyang

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=1475912677-19190-2-git-send-email-douly.fnst@cn.fujitsu.com \
    --to=douly.fnst@cn.fujitsu.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yinghai@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;
as well as URLs for NNTP newsgroup(s).