>+ /* ebp isn't valid for newly created threads, but eip is. */
>+ eip = p->tss.eip;
>+ if (eip < first_sched || eip >= last_sched)
>+ return eip;
Right.
> stack_page = (unsigned long)p;
> esp = p->tss.esp;
>- if (!stack_page || esp < stack_page || esp >= 8188+stack_page)
>+ if (!stack_page || esp < stack_page || esp > 8188+stack_page)
Wrong. Dereferencing esp will not fault if it will be equal to
8188+stack_page.
> return 0;
> /* include/asm-i386/system.h:switch_to() pushes ebp last. */
> ebp = *(unsigned long *) esp;
> do {
>- if (ebp < stack_page || ebp >= 8188+stack_page)
>+ if (ebp < stack_page || ebp > 8184+stack_page)
Also here the check can be `ebp >= 8184+stack_page'.
Tell me if it' s too late to thing to these issues ;)
Andrea Arcangeli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/