linux/arch/x86
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
..
boot x86: add support for LZO-compressed kernels 2010-01-11 09:34:05 -08:00
configs tracing: Rename FTRACE_SYSCALLS for tracepoints 2009-08-26 00:17:35 +02:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-12-01 15:16:22 +08:00
ia32 x86: get rid of the insane TIF_ABI_PENDING bit 2010-01-29 08:22:01 -08:00
include/asm x86/PCI: use host bridge _CRS info by default on 2008 and newer machines 2010-02-23 09:43:42 -08:00
kernel Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-02-22 08:55:32 -08:00
kvm KVM: PIT: control word is write-only 2010-02-09 19:20:15 +02:00
lguest lguest: move panic notifier registration to its expected place. 2009-09-23 22:26:44 +09:30
lib Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent 2009-12-28 09:23:13 +01:00
math-emu Merge branch 'core/percpu' into percpu-cpumask-x86-for-linus-2 2009-03-27 17:28:43 +01:00
mm Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-02-11 14:01:10 -08:00
oprofile oprofile/x86: add Xeon 7500 series support 2010-01-25 15:34:53 +01:00
pci x86/PCI: Prevent mmconfig memory corruption 2010-02-25 08:30:58 -08:00
power hw-breakpoints: Rewrite the hw-breakpoints layer on top of perf events 2009-11-08 15:34:42 +01:00
tools Merge branch 'iommu/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu into x86/urgent 2009-12-28 09:23:13 +01:00
vdso sysctl x86: Remove dead binary sysctl support 2009-11-12 02:05:04 -08:00
video
xen x86: xen: 64-bit kernel RPL should be 0 2010-01-13 11:23:54 +01:00
Kbuild x86: standardize Kbuild rules 2009-04-16 18:09:02 +02:00
Kconfig x86: Remove "x86 CPU features in debugfs" (CONFIG_X86_CPU_DEBUG) 2010-01-23 18:27:47 -08:00
Kconfig.cpu Revert "x86: Side-step lguest problem by only building cmpxchg8b_emu for pre-Pentium" 2010-01-05 16:01:35 -08:00
Kconfig.debug Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-11 20:47:30 -08:00
Makefile Merge branch 'perf/core' into perf/probes 2009-11-17 10:17:47 +01:00
Makefile_32.cpu Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:38:11 -08:00