Files
linux/arch
Thomas Gleixner 8a2b4a7256 x86/PCI: Prevent mmconfig memory corruption
commit bb8d41330c upstream.

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>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-15 09:06:00 -07:00
..
2010-02-23 16:07:25 -08:00
2009-12-16 07:20:12 -08:00
2010-02-22 21:42:12 +01:00
2010-02-24 17:30:36 +00:00
2010-02-09 09:46:23 +01:00
2010-02-15 14:17:45 +09:00
2010-01-14 09:05:26 -05:00