From 7e59fbeb2f05e1400dadbbd2d9c93d8bd2ad8178 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 22 Mar 2014 16:33:25 +0100 Subject: Fix overflow We were filling much more than the mapwindows array, thus overwriting in at least debugger variables. * i386/intel/pmap.c (pmap_bootstrap): Make sure to limit mapwindows initialization within PMAP_NMAPWINDOWS. --- i386/intel/pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'i386/intel') diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index a3d9630..4b2892a 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -780,7 +780,7 @@ void pmap_bootstrap(void) } for (; pte < ptable+NPTES; pte++) { - if (va >= kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE); + if (va >= kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE && va < kernel_virtual_end) { pmap_mapwindow_t *win = &mapwindows[atop(va - (kernel_virtual_end - PMAP_NMAPWINDOWS * PAGE_SIZE))]; win->entry = pte; -- cgit v1.2.3