Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756614AbbBEFm7 (ORCPT ); Thu, 5 Feb 2015 00:42:59 -0500 Received: from mga01.intel.com ([192.55.52.88]:62564 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756576AbbBEFm5 (ORCPT ); Thu, 5 Feb 2015 00:42:57 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,522,1418112000"; d="scan'208";a="647613841" From: Jiang Liu To: "Rafael J. Wysocki" , Thomas Gleixner , Bjorn Helgaas , Yinghai Lu , Borislav Petkov , Lv Zheng , Len Brown Cc: Jiang Liu , Tony Luck , x86@kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org Subject: [Patch v4 12/23] ACPI: Enforce stricter checks for address space descriptors Date: Thu, 5 Feb 2015 13:44:38 +0800 Message-Id: <1423115089-12904-13-git-send-email-jiang.liu@linux.intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423115089-12904-1-git-send-email-jiang.liu@linux.intel.com> References: <1423115089-12904-1-git-send-email-jiang.liu@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1264 Lines: 36 Enforce stricter checks for address space descriptors according to ACPI spec. Signed-off-by: Jiang Liu --- drivers/acpi/resource.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 5bf73a9f26d9..57891a621b96 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c @@ -192,6 +192,15 @@ static bool acpi_decode_space(struct resource *res, bool wp = addr->info.mem.write_protect; u64 len = attr->address_length; + /* + * Filter out invalid descriptor according to ACPI Spec 5.0, section + * 6.4.3.5 Address Space Resource Descriptors. + */ + if ((addr->min_address_fixed != addr->max_address_fixed && len) || + (addr->min_address_fixed && addr->max_address_fixed && !len)) + pr_debug("ACPI: Invalid address space min_addr_fix %d, max_addr_fix %d, len %llx\n", + addr->min_address_fixed, addr->max_address_fixed, len); + res->start = attr->minimum; res->end = attr->maximum; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/