OpenCloudOS-Kernel/arch/x86/pci
Thomas Gleixner bb8d41330c x86/PCI: Prevent mmconfig memory corruption
commit ff097ddd4 (x86/PCI: MMCONFIG: manage pci_mmcfg_region as a
list, not a table) introduced a nasty memory corruption when
pci_mmcfg_list is empty.

pci_mmcfg_check_end_bus_number() dereferences pci_mmcfg_list.prev even
when the list is empty. The following write hits some variable near to
pci_mmcfg_list.

Further down a similar problem exists, where cfg->list.next is
dereferenced unconditionally and a comparison with some variable near
to pci_mmcfg_list happens.

Add a check for the last element into the for_each_entry() loop and
remove all the other crappy logic which is just a leftover of the old
array based code which was replaced by the list conversion.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: stable@kernel.org
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2010-02-25 08:30:58 -08:00
..
Makefile x86/PCI: remove IOH range fetching 2010-01-28 08:24:11 -08:00
acpi.c x86/PCI: use host bridge _CRS info by default on 2008 and newer machines 2010-02-23 09:43:42 -08:00
amd_bus.c x86/pci: seperate x86_pci_rootbus_res_quirks from amd_bus.c 2009-11-24 15:25:59 -08:00
bus_numa.c PCI: augment bus resource table with a list 2010-02-23 09:43:37 -08:00
bus_numa.h PCI: augment bus resource table with a list 2010-02-23 09:43:37 -08:00
common.c x86/PCI: use host bridge _CRS info by default on 2008 and newer machines 2010-02-23 09:43:42 -08:00
direct.c dmi: extend dmi_get_year() to dmi_get_date() 2009-09-08 21:17:48 -04:00
early.c x86/PCI: remove early PCI pr_debug statements 2009-11-24 15:25:19 -08:00
fixup.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-04-01 09:47:12 -07:00
i386.c resource/PCI: mark struct resource as const 2010-02-22 16:16:57 -08:00
init.c PCI: avoid early PCI mmconfig init if pci=noearly is given in cmdline 2009-01-07 11:12:46 -08:00
irq.c x86/PCI: irq and pci_ids patch for Intel Cougar Point DeviceIDs 2010-02-22 16:16:55 -08:00
legacy.c x86/PCI: make pci=lastbus=255 work when acpi is on 2009-03-26 16:07:49 -07:00
mmconfig-shared.c x86/PCI: Prevent mmconfig memory corruption 2010-02-25 08:30:58 -08:00
mmconfig_32.c x86/PCI: MMCONFIG: add lookup function 2009-11-24 15:30:36 -08:00
mmconfig_64.c x86/PCI: MMCONFIG: add lookup function 2009-11-24 15:30:36 -08:00
numaq_32.c x86, apic: remove genapic.h 2009-02-17 17:52:44 +01:00
olpc.c x86, pci: move arch/x86/pci/pci.h to arch/x86/include/asm/pci_x86.h 2008-12-29 18:17:36 +01:00
pcbios.c x86: move mach-default/*.h files to asm/ 2009-01-29 14:16:51 +01:00
visws.c PCI: x86/visws: use generic INTx swizzle from PCI core 2009-01-07 11:13:16 -08:00