Re: [PATCH] Fix for vmalloc problem was Re: 2.6.10-rc1-mm3

From: Andi Kleen
Date: Fri Nov 05 2004 - 09:00:12 EST


On Sat, Nov 06, 2004 at 12:29:43AM +1100, Con Kolivas wrote:
> Andi Kleen wrote:
> >On Fri, Nov 05, 2004 at 11:16:24PM +1100, Con Kolivas wrote:
> >
> >>Andi Kleen wrote:
> >>
> >>>Con Kolivas <kernel@xxxxxxxxxxx> writes:
> >>>
> >>>
> >>>
> >>>>It's life Jim but not as we know it...
> >>>>
> >>>>
> >>>>This happened during modprobe of alsa modules. Keyboard still alive,
> >>>>everything else dead; not even sysrq would do anything, netconsole had
> >>>>no output, luckily this made it to syslog:
> >>>
> >>>
> >>>I just tested modprobing of alsa (snd_intel8x0) and it works for me.
> >>>Also vmalloc must work at least to some point.
> >>>
> >>>Can you confirm it's really caused by 4level by reverting all the
> >>>4level-* patches from broken out?
> >>
> >>I dont recall blaming 4level. When I get a chance I'll try.
> >
> >
> >This patch should fix it. Can you please test? Thanks.
> >
> >-Andi
> >
> >Fix silly typo in mm/vmalloc.c and some minor cleanups.
>
> Boots fine now thanks.

It broke x86-64 unfortunately. This version should be better and is
simpler. Andrew, if you applied the previous version please replace
with this one.

-Andi

Fix vmalloc overflow with 4levels.

Signed-off-by: Andi Kleen <ak@xxxxxxx>


diff -up linux-2.6.10rc1-mm3/mm/vmalloc.c-o linux-2.6.10rc1-mm3/mm/vmalloc.c
--- linux-2.6.10rc1-mm3/mm/vmalloc.c-o 2004-11-05 11:42:00.000000000 +0100
+++ linux-2.6.10rc1-mm3/mm/vmalloc.c 2004-11-05 14:49:25.000000000 +0100
@@ -213,7 +213,7 @@ int map_vm_area(struct vm_struct *area,
err = -ENOMEM;
break;
}
- next = (address + PGDIR_SIZE) & PGDIR_MASK;
+ next = (address + PML4_SIZE) & PML4_MASK;
if (next < address || next > end)
next = end;
if (map_area_pgd(pgd, address, next, prot, pages)) {


-
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/