Re: 2.6.12-rc1 breaks dosemu

From: Arjan van de Ven
Date: Sat Mar 26 2005 - 03:27:14 EST


On Fri, 2005-03-25 at 23:54 +0100, Arnd Bergmann wrote:
> On Freedag 25 MÃrz 2005 20:14, Arjan van de Ven wrote:
>
> > the randomisation patches came in a series of 8 patches (where several
> > were general infrastructure); could you try to disable the individual
> > randomisations one at a time to see which one causes this effect?
>
> It's caused by top-of-stack-randomization.patch.
>

looking at the dosemu code; the following bit looks a tad suspect:

unsigned long int stk_ptr, stk_beg, stk_end;
...
if ((fp = fopen("/proc/self/maps", "r"))) {
while(fgets(line, 100, fp)) {
sscanf(line, "%lx-%lx", &stk_beg, &stk_end);
if (stk_ptr >= stk_beg && stk_ptr < stk_end) {
stack_init_top = stk_end;
stack_init_bot = stk_beg;
c_printf("CPU: Stack bottom %#lx, top %#lx, esp=%#lx\n",
stack_init_bot, stack_init_top, stk_ptr);
break;
}
}
fclose(fp);
}

do you see that printf somewhere in the logs?
(afaics stk_ptr never gets initialized; what the code meant probably was
if (&stk_ptr >= stk_beg && &stk_ptr < stk_end) {
but the dosemu code is missing the two &'s )

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