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
| ||
|
Date: Thu, 23 Feb 2012 19:48:53 -0800 From: Yinghai Lu <yinghai@...nel.org> To: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>, Jesse Barnes <jbarnes@...tuousgeek.org> Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org, Yinghai Lu <yinghai@...nel.org>, Ingo Molnar <mingo@...hat.com>, Suresh Siddha <suresh.b.siddha@...el.com> Subject: [PATCH 07/13] x86, irq: more strict check for register ioapic 1. check overlaping gsi range for hotplug ioapic case, BIOS may have some entries in MADT and also in pci bus with _GSB. 2. make bad_ioapics take idx instead of nr_ioapics. for hotadd ioapic could find spare slot in the middle later. 3. check if entries in right range. Signed-off-by: Yinghai Lu <yinghai@...nel.org> Cc: Thomas Gleixner <tglx@...utronix.de> Cc: Ingo Molnar <mingo@...hat.com> Cc: "H. Peter Anvin" <hpa@...or.com> Cc: Suresh Siddha <suresh.b.siddha@...el.com> --- arch/x86/kernel/apic/io_apic.c | 19 ++++++++++++++----- 1 files changed, 14 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 527b184..57ffa86 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -4065,11 +4065,11 @@ int mp_find_ioapic_pin(int ioapic, u32 gsi) return gsi - gsi_cfg->gsi_base; } -static __init int bad_ioapic(unsigned long address) +static __init int bad_ioapic(int idx, unsigned long address) { - if (nr_ioapics >= MAX_IO_APICS) { + if (idx >= MAX_IO_APICS) { printk(KERN_WARNING "WARNING: Max # of I/O APICs (%d) exceeded " - "(found %d), skipping\n", MAX_IO_APICS, nr_ioapics); + "(found %d), skipping\n", MAX_IO_APICS, idx); return 1; } if (!address) { @@ -4082,14 +4082,17 @@ static __init int bad_ioapic(unsigned long address) void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) { - int idx = 0; + int idx; int entries; struct mp_ioapic_gsi *gsi_cfg; - if (bad_ioapic(address)) + idx = mp_find_ioapic(gsi_base); + if (idx >= 0) return; idx = nr_ioapics; + if (bad_ioapic(idx, address)) + return; ioapics[idx].mp_config.type = MP_IOAPIC; ioapics[idx].mp_config.flags = MPC_APIC_USABLE; @@ -4104,6 +4107,12 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) * and to prevent reprogramming of IOAPIC pins (PCI GSIs). */ entries = io_apic_get_redir_entries(idx); + + if (!entries || entries > MP_MAX_IOAPIC_PIN) { + clear_fixmap(FIX_IO_APIC_BASE_0 + idx); + return; + } + gsi_cfg = mp_ioapic_gsi_routing(idx); gsi_cfg->gsi_base = gsi_base; gsi_cfg->gsi_end = gsi_base + entries - 1; -- 1.7.7 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists