Re: [PATCH] x86, AMD: Correct F15h IC aliasing issue

From: Borislav Petkov
Date: Tue Jul 26 2011 - 14:40:02 EST


On Tue, Jul 26, 2011 at 02:34:30PM -0400, Ingo Molnar wrote:
>
> * Borislav Petkov <bp@xxxxxxxxx> wrote:
>
> > Ok, I went and installed a Debian wheezy with gnome and started
> > almost everything I could find in the startup menu. Kernel is 3.0
> > with Linus' simpler fix.
> >
> > The attached file shows all libraries which would create aliases
> > (i.e. 2 or more unique values for bits [14:12] along with the
> > respective count) in the total of:
> >
> > Total r-xp mappings: 831, aliasing: 240 (0.289%)
>
> 28.9%, right?

Yessir.

> > For example, libc gets mapped into all possible slots for [14:12]
> >
> > Library [14:12] count
> > ======= ======= =====
> > /lib/libc-2.11.2.so
> > 0 12
> > 1 12
> > 2 11
> > 3 12
> > 4 13
> > 5 16
> > 6 13
> > 7 9
> >
> >
> > and so on.
>
> Was this done with a stock kernel, or with the simple patch applied?

with the simplest version of Linus' patch:

diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
index 1dab519..6b1094d 100644
--- a/arch/x86/mm/mmap.c
+++ b/arch/x86/mm/mmap.c
@@ -90,6 +90,8 @@ static unsigned long mmap_rnd(void)
rnd = (long)get_random_int() % (1<<8);
else
rnd = (long)(get_random_int() % (1<<28));
+
+ rnd &= ~0x7;
}
return rnd << PAGE_SHIFT;
}

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/