lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue,  1 Dec 2020 16:45:10 -0800
From:   Dexuan Cui <decui@...rosoft.com>
To:     tglx@...utronix.de, dwmw@...zon.co.uk, x86@...nel.org,
        decui@...rosoft.com, mikelley@...rosoft.com,
        linux-hyperv@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, Tianyu.Lan@...rosoft.com,
        vkuznets@...hat.com, kys@...rosoft.com, haiyangz@...rosoft.com,
        sthemmin@...rosoft.com, wei.liu@...nel.org
Subject: [PATCH] iommu/hyper-v: Fix panic on a host without the 15-bit APIC ID support

The commit f36a74b9345a itself is good, but it causes a panic in a
Linux VM that runs on a Hyper-V host that doesn't have the 15-bit
Extended APIC ID support:
    kernel BUG at arch/x86/kernel/apic/io_apic.c:2408!

This happens because the Hyper-V ioapic_ir_domain (which is defined in
drivers/iommu/hyperv-iommu.c) can not be found. Fix the panic by
properly claiming the only I/O APIC emulated by Hyper-V.

Cc: David Woodhouse <dwmw@...zon.co.uk>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>
Fixes: f36a74b9345a ("x86/ioapic: Use I/O-APIC ID for finding irqdomain, not index")
Signed-off-by: Dexuan Cui <decui@...rosoft.com>
---
 drivers/iommu/hyperv-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


This patch is for the tip.git tree's x86/apic branch.

diff --git a/drivers/iommu/hyperv-iommu.c b/drivers/iommu/hyperv-iommu.c
index 9438daa24fdb..1d21a0b5f724 100644
--- a/drivers/iommu/hyperv-iommu.c
+++ b/drivers/iommu/hyperv-iommu.c
@@ -105,8 +105,8 @@ static int hyperv_irq_remapping_select(struct irq_domain *d,
 				       struct irq_fwspec *fwspec,
 				       enum irq_domain_bus_token bus_token)
 {
-	/* Claim only the first (and only) I/OAPIC */
-	return x86_fwspec_is_ioapic(fwspec) && fwspec->param[0] == 0;
+	/* Claim the only I/O APIC emulated by Hyper-V */
+	return x86_fwspec_is_ioapic(fwspec);
 }
 
 static const struct irq_domain_ops hyperv_ir_domain_ops = {

base-commit: d1adcfbb520c43c10fc22fcdccdd4204e014fb53
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ