lkml.org 
[lkml]   [1998]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] i386 get_wchan() bugs (fs/proc/array.c)
On Thu, 10 Dec 1998, Jamie Lokier wrote:

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

\
 
 \ /
  Last update: 2005-03-22 13:46    [from the cache]
©2003-2011 Jasper Spaans